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')