From 720076d5d1ded2d7c3ca52161b7aa719318077f4 Mon Sep 17 00:00:00 2001 From: j Date: Tue, 5 Apr 2016 11:04:30 +0200 Subject: [PATCH] only publish static lists --- oml/user/models.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) 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