cleanup scrape before removing book

This commit is contained in:
j 2015-11-16 16:35:42 +01:00
parent a24061518a
commit 909e38c302

View file

@ -228,6 +228,7 @@ class Item(db.Model):
def delete(self, commit=True): def delete(self, commit=True):
Sort.query.filter_by(item_id=self.id).delete() Sort.query.filter_by(item_id=self.id).delete()
Transfer.query.filter_by(item_id=self.id).delete() Transfer.query.filter_by(item_id=self.id).delete()
Scrape.query.filter_by(item_id=self.id).delete()
state.db.session.delete(self) state.db.session.delete(self)
if commit: if commit:
state.db.session.commit() state.db.session.commit()