diff options
author | Leif Johansson <leifj@sunet.se> | 2011-10-12 01:05:03 +0200 |
---|---|---|
committer | Leif Johansson <leifj@sunet.se> | 2011-10-12 01:05:03 +0200 |
commit | 2c10cb6783feabd6a5f35d410042c2530f2c6b9c (patch) | |
tree | c3595fac49852810ce2fbe10d6482d7c85b37ffd | |
parent | ee95c0165446ad3d6546cba03bba0107ae10fb17 (diff) |
need to convert to int for -
-rw-r--r-- | src/meetingtools/apps/room/models.py | 6 | ||||
-rw-r--r-- | src/meetingtools/apps/room/views.py | 2 |
2 files changed, 7 insertions, 1 deletions
diff --git a/src/meetingtools/apps/room/models.py b/src/meetingtools/apps/room/models.py index b636816..37b9475 100644 --- a/src/meetingtools/apps/room/models.py +++ b/src/meetingtools/apps/room/models.py @@ -45,6 +45,12 @@ class Room(models.Model): else: return int(time.mktime(self.lastvisited.timetuple())*1000) + def lastupdate(self): + if not self.lastupdated: + return 0 + else: + return int(time.mktime(self.lastupdated.timetuple())*1000) + def go_url(self): return "%s/go/%s" % (BASE_URL,self.urlpath) diff --git a/src/meetingtools/apps/room/views.py b/src/meetingtools/apps/room/views.py index 2140cc9..66146e9 100644 --- a/src/meetingtools/apps/room/views.py +++ b/src/meetingtools/apps/room/views.py @@ -247,7 +247,7 @@ def _import_room(request,acc,r): if not room: return None - if abs(room.lastupdated - time.time()) < IMPORT_TTL: + if abs(room.lastupdate() - time.time()) < IMPORT_TTL: return room api = ac_api_client(request,acc) |