mirror of
https://gitlab.ub.uni-bielefeld.de/sfb1288inf/nopaque.git
synced 2024-12-25 02:44:18 +00:00
Also delete corpus files when a corpus gets deleted
This commit is contained in:
parent
0a8f6a5a44
commit
7dcc8c48da
@ -63,5 +63,7 @@ def background_delete_corpus(app, corpus_id):
|
|||||||
logger.warning('Called by delete_thread.')
|
logger.warning('Called by delete_thread.')
|
||||||
logger.warning('Corpus id is: {}.'.format(corpus_id))
|
logger.warning('Corpus id is: {}.'.format(corpus_id))
|
||||||
corpus = Corpus.query.filter_by(id=corpus_id).first()
|
corpus = Corpus.query.filter_by(id=corpus_id).first()
|
||||||
logger.warning('Corpus object is: {}'.format(corpus))
|
for corpus_file in corpus.files:
|
||||||
|
db.session.delete(corpus_file)
|
||||||
|
logger.warning('Corpus object is: {}'.format(corpus))
|
||||||
corpus.delete_corpus()
|
corpus.delete_corpus()
|
||||||
|
Loading…
Reference in New Issue
Block a user