Skip to content
Snippets Groups Projects
Commit 2b3d08b2 authored by Stephan Porada's avatar Stephan Porada :speech_balloon:
Browse files

Merge branch 'development' of gitlab.ub.uni-bielefeld.de:sfb1288inf/nopaque into development

parents ab1d9a20 b69c54a7
No related branches found
No related tags found
No related merge requests found
......@@ -504,13 +504,13 @@ class CorpusFile(db.Model):
title = db.Column(db.String(255))
def delete(self):
corpus_file = os.path.join(current_app.config['NOPAQUE_STORAGE'],
str(self.corpus.user_id),
'corpora',
str(self.corpus_id),
self.filename)
corpus_file_path = os.path.join(current_app.config['NOPAQUE_STORAGE'],
str(self.corpus.user_id),
'corpora',
str(self.corpus_id),
self.filename)
try:
os.remove(corpus_file)
os.remove(corpus_file_path)
except OSError:
pass
db.session.delete(self)
......@@ -632,7 +632,10 @@ class Result(db.Model):
def delete(self):
result_file_path = os.path.join(current_app.config['NOPAQUE_STORAGE'],
self.file[0].dir)
shutil.rmtree(result_file_path)
try:
os.remove(result_file_path)
except OSError:
pass
db.session.delete(self)
def __repr__(self):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment