From fc7b3ee049580d69b4281769ffd8403defc27f18 Mon Sep 17 00:00:00 2001 From: j Date: Mon, 26 May 2014 10:22:43 +0200 Subject: [PATCH] move addlist --- 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 22e26dc..70bb42d 100644 --- a/oml/user/models.py +++ b/oml/user/models.py @@ -182,11 +182,11 @@ class List(db.Model): l._query = query l.type = 'smart' if l._query else 'static' l.index_ = cls.query.filter_by(user_id=user_id).count() + db.session.add(l) + db.session.commit() if user_id == settings.USER_ID: if not l._query: Changelog.record(state.user(), 'addlist', l.name) - db.session.add(l) - db.session.commit() return l @classmethod