|
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 $ |
2 | 2 |
|
3 | 3 | import re, cgi, StringIO, urllib, Cookie, time, random |
4 | 4 |
|
@@ -459,17 +459,21 @@ def _createnode(self, cn, props): |
459 | 459 | class EditItemAction(_EditAction): |
460 | 460 | def lastUserActivity(self): |
461 | 461 | if self.form.has_key(':lastactivity'): |
462 | | - return date.Date(self.form[':lastactivity'].value) |
| 462 | + d = date.Date(self.form[':lastactivity'].value) |
463 | 463 | elif self.form.has_key('@lastactivity'): |
464 | | - return date.Date(self.form['@lastactivity'].value) |
| 464 | + d = date.Date(self.form['@lastactivity'].value) |
465 | 465 | else: |
466 | 466 | return None |
| 467 | + d.second = int(d.second) |
467 | 468 |
|
468 | 469 | def lastNodeActivity(self): |
469 | 470 | 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 |
471 | 474 |
|
472 | 475 | def detectCollision(self, user_activity, node_activity): |
| 476 | + print (user_activity, node_activity) |
473 | 477 | if user_activity: |
474 | 478 | return user_activity < node_activity |
475 | 479 |
|
|
0 commit comments