add/remove item can not depend on timestamp
This commit is contained in:
parent
fb95a1ec55
commit
49763389be
1 changed files with 9 additions and 10 deletions
|
@ -128,12 +128,12 @@ class Changelog(db.Model):
|
|||
def action_additem(self, user, timestamp, itemid, info):
|
||||
from item.models import Item
|
||||
i = Item.get(itemid)
|
||||
if i and i.timestamp > timestamp:
|
||||
if i:
|
||||
if user not in i.users:
|
||||
i.users.append(user)
|
||||
i.update()
|
||||
return True
|
||||
if not i:
|
||||
else:
|
||||
i = Item.get_or_create(itemid, info)
|
||||
i.modified = ts2datetime(timestamp)
|
||||
if user not in i.users:
|
||||
|
@ -173,8 +173,7 @@ class Changelog(db.Model):
|
|||
def action_removeitem(self, user, timestamp, itemid):
|
||||
from item.models import Item
|
||||
i = Item.get(itemid)
|
||||
if not i or i.timestamp > timestamp:
|
||||
return True
|
||||
if i:
|
||||
if user in i.users:
|
||||
i.users.remove(user)
|
||||
if i.users:
|
||||
|
|
Loading…
Reference in a new issue