Set status on upload, edit, or delete

This commit is contained in:
Stephan Porada 2019-11-06 10:04:29 +01:00
parent 2d4559e4fe
commit 64dce7ed28

View File

@ -422,6 +422,7 @@ class CorpusFile(db.Model):
except: except:
logger.warning('[ERROR] CorpusFile.delete') logger.warning('[ERROR] CorpusFile.delete')
return return
self.corpus.status = 'unprepared'
db.session.delete(self) db.session.delete(self)
db.session.commit() db.session.commit()
@ -435,6 +436,8 @@ class CorpusFile(db.Model):
text_node.set('publishing_year', str(self.publishing_year)) text_node.set('publishing_year', str(self.publishing_year))
text_node.set('title', self.title) text_node.set('title', self.title)
element_tree.write(file) element_tree.write(file)
self.corpus.status = 'unprepared'
db.session.commit()
class Corpus(db.Model): class Corpus(db.Model):