only create list if it does not exist

This commit is contained in:
j 2016-01-22 12:38:41 +05:30
parent 3540ba29b0
commit b31e73c740

View file

@ -191,7 +191,7 @@ class Changelog(db.Model):
from user.models import List from user.models import List
if name == '': if name == '':
return True return True
l = List.create(user.id, name) l = List.get_or_create(user.id, name)
trigger_event('addlist', {'id': l.public_id, 'user': user.id}) trigger_event('addlist', {'id': l.public_id, 'user': user.id})
return True return True