From 2c10cb6783feabd6a5f35d410042c2530f2c6b9c Mon Sep 17 00:00:00 2001 From: Leif Johansson Date: Wed, 12 Oct 2011 01:05:03 +0200 Subject: need to convert to int for - --- src/meetingtools/apps/room/models.py | 6 ++++++ src/meetingtools/apps/room/views.py | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) 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) -- cgit v1.1