avoid one commit
This commit is contained in:
parent
fc11869088
commit
8fa5d10122
1 changed files with 2 additions and 1 deletions
|
@ -350,6 +350,8 @@ class Item(db.Model):
|
||||||
for key in self.meta_keys:
|
for key in self.meta_keys:
|
||||||
if key not in self.meta and key in self.info:
|
if key not in self.meta and key in self.info:
|
||||||
self.meta[key] = self.info[key]
|
self.meta[key] = self.info[key]
|
||||||
|
del self.info[key]
|
||||||
|
|
||||||
#FIXME get from user_meta
|
#FIXME get from user_meta
|
||||||
if state.online:
|
if state.online:
|
||||||
if 'isbn' in self.meta:
|
if 'isbn' in self.meta:
|
||||||
|
@ -418,7 +420,6 @@ class Item(db.Model):
|
||||||
self.users.remove(user)
|
self.users.remove(user)
|
||||||
for l in self.lists.filter_by(user_id=user.id):
|
for l in self.lists.filter_by(user_id=user.id):
|
||||||
l.items.remove(self)
|
l.items.remove(self)
|
||||||
state.db.session.commit()
|
|
||||||
if not self.users:
|
if not self.users:
|
||||||
self.delete()
|
self.delete()
|
||||||
else:
|
else:
|
||||||
|
|
Loading…
Reference in a new issue