From e2268f9234d58b30e8158ef03f3b1ab28752462d Mon Sep 17 00:00:00 2001
From: Patrick Jentsch
Date: Wed, 30 Oct 2019 09:02:45 +0100
Subject: [PATCH] add some debug logs
---
app/models.py | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/app/models.py b/app/models.py
index da5275d9..962aee73 100644
--- a/app/models.py
+++ b/app/models.py
@@ -412,6 +412,7 @@ class CorpusFile(db.Model):
def delete(self):
logger = logging.getLogger(__name__)
+ logger.warning('Called CorpusFile.delete')
path = os.path.join(current_app.config['OPAQUE_STORAGE_DIRECTORY'],
self.dir,
self.filename)
@@ -459,13 +460,20 @@ class Corpus(db.Model):
def delete(self):
logger = logging.getLogger(__name__)
+ logger.warning('Called Corpus.delete')
for corpus_file in self.files:
corpus_file.delete()
+ logger.warning('bis hierhin und nicht weiter')
+ logger.warning('base_dir: {}'.format(current_app.config['OPAQUE_STORAGE_DIRECTORY']))
+ logger.warning('user_id: {}'.format(self.user_id))
+ logger.warning('id: {}'.format(self.id))
path = os.path.join(current_app.config['OPAQUE_STORAGE_DIRECTORY'],
self.user_id,
'corpora',
self.id)
+ logger.warning(path)
try:
+ logger.warning('Try to remove {}'.format(path))
shutil.rmtree(path)
except:
logger.warning('[ERROR] Corpus.delete')