fix rename user

This commit is contained in:
j 2019-01-17 14:50:48 +05:30
parent 608c9ea696
commit 5ad4d1d67c

View file

@ -307,7 +307,7 @@ class List(db.Model):
@classmethod @classmethod
def rename_user(cls, old, new): def rename_user(cls, old, new):
for l in cls.query.filter(cls._query is not None): for l in cls.query.filter(cls._query != None):
def update_conditions(conditions): def update_conditions(conditions):
changed = False changed = False
@ -320,7 +320,7 @@ class List(db.Model):
changed = True changed = True
return changed return changed
if update_conditions(l._query.get('conditions', [])): if l._query and update_conditions(l._query.get('conditions', [])):
l.save() l.save()
def add_items(self, items, commit=True): def add_items(self, items, commit=True):