From a0c197026f350122e75f89692e828c0eb8bef7f5 Mon Sep 17 00:00:00 2001 From: j Date: Thu, 7 Jan 2016 10:07:44 +0530 Subject: [PATCH] really remove ghost lists --- oml/setup.py | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/oml/setup.py b/oml/setup.py index bfea38e..f30911a 100644 --- a/oml/setup.py +++ b/oml/setup.py @@ -263,16 +263,11 @@ def upgrade_db(old, new=None): u.clear_list_cache() l.items_count() session.commit() - if old <= '20160106-500-4c87307': - 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': + if old <= '20160107-507-16c9807': with db.session() as session: for l in user.models.List.query.filter_by(name=' [2]'): if not len(l.items): - l.delete() + l.remove() def create_default_lists(user_id=None): with db.session():