really remove ghost lists
This commit is contained in:
parent
16c9807dbf
commit
a0c197026f
1 changed files with 2 additions and 7 deletions
|
@ -263,16 +263,11 @@ def upgrade_db(old, new=None):
|
||||||
u.clear_list_cache()
|
u.clear_list_cache()
|
||||||
l.items_count()
|
l.items_count()
|
||||||
session.commit()
|
session.commit()
|
||||||
if old <= '20160106-500-4c87307':
|
if old <= '20160107-507-16c9807':
|
||||||
with db.session() as session:
|
|
||||||
l = user.models.List.query.filter_by(name=' [2]', user_id=settings.USER_ID).first()
|
|
||||||
if l and not len(l.items):
|
|
||||||
l.delete()
|
|
||||||
if old <= '20160106-505-9689439':
|
|
||||||
with db.session() as session:
|
with db.session() as session:
|
||||||
for l in user.models.List.query.filter_by(name=' [2]'):
|
for l in user.models.List.query.filter_by(name=' [2]'):
|
||||||
if not len(l.items):
|
if not len(l.items):
|
||||||
l.delete()
|
l.remove()
|
||||||
|
|
||||||
def create_default_lists(user_id=None):
|
def create_default_lists(user_id=None):
|
||||||
with db.session():
|
with db.session():
|
||||||
|
|
Loading…
Reference in a new issue