only publish static lists
This commit is contained in:
parent
876f511f45
commit
720076d5d1
1 changed files with 6 additions and 3 deletions
|
@ -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
|
||||
|
||||
|
|
Loading…
Reference in a new issue