Skip to content

Commit 22436c0

Browse files
author
Richard Jones
committed
collision detection only at second granularity
1 parent 3846eec commit 22436c0

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

roundup/cgi/actions.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#$Id: actions.py,v 1.25 2004-05-04 05:56:54 richard Exp $
1+
#$Id: actions.py,v 1.26 2004-05-06 02:03:42 richard Exp $
22

33
import re, cgi, StringIO, urllib, Cookie, time, random
44

@@ -459,17 +459,21 @@ def _createnode(self, cn, props):
459459
class EditItemAction(_EditAction):
460460
def lastUserActivity(self):
461461
if self.form.has_key(':lastactivity'):
462-
return date.Date(self.form[':lastactivity'].value)
462+
d = date.Date(self.form[':lastactivity'].value)
463463
elif self.form.has_key('@lastactivity'):
464-
return date.Date(self.form['@lastactivity'].value)
464+
d = date.Date(self.form['@lastactivity'].value)
465465
else:
466466
return None
467+
d.second = int(d.second)
467468

468469
def lastNodeActivity(self):
469470
cl = getattr(self.client.db, self.classname)
470-
return cl.get(self.nodeid, 'activity')
471+
activity = cl.get(self.nodeid, 'activity').local(0)
472+
activity.second = int(activity.second)
473+
return activity
471474

472475
def detectCollision(self, user_activity, node_activity):
476+
print (user_activity, node_activity)
473477
if user_activity:
474478
return user_activity < node_activity
475479

0 commit comments

Comments
 (0)