diff --git a/oml/user/models.py b/oml/user/models.py index 9640c0a..d95681c 100644 --- a/oml/user/models.py +++ b/oml/user/models.py @@ -290,13 +290,16 @@ class List(db.Model): name = '%s [%s]' % (prefix, n) n += 1 l = cls(user_id=user_id, name=name) - l._query = query - l.type = 'smart' if l._query else 'static' + if query: + l._query = query + l.type = 'smart' + else: + l.type = 'static' l.index_ = cls.query.filter_by(user_id=user_id).count() state.db.session.add(l) state.db.session.commit() if user_id == settings.USER_ID: - if not l._query and name != '': + if l.type == 'static' and name != '': Changelog.record(state.user(), 'addlist', l.name) return l