From 5ad4d1d67c8fd102065a404b6bd6f6613148aa3b Mon Sep 17 00:00:00 2001 From: j Date: Thu, 17 Jan 2019 14:50:48 +0530 Subject: [PATCH] fix rename user --- oml/user/models.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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):