cleanup scrape before removing book

This commit is contained in:
j 2015-11-16 16:35:42 +01:00
parent a24061518a
commit 909e38c302
1 changed files with 1 additions and 0 deletions

View File

@ -228,6 +228,7 @@ class Item(db.Model):
def delete(self, commit=True):
Sort.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)
if commit:
state.db.session.commit()