diff --git a/oml/user/models.py b/oml/user/models.py index 22d76e9..f5c812d 100644 --- a/oml/user/models.py +++ b/oml/user/models.py @@ -307,7 +307,7 @@ class List(db.Model): @classmethod 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): changed = False @@ -320,7 +320,7 @@ class List(db.Model): changed = True return changed - if update_conditions(l._query.get('conditions', [])): + if l._query and update_conditions(l._query.get('conditions', [])): l.save() def add_items(self, items, commit=True):