summaryrefslogtreecommitdiff
path: root/src/meetingtools/apps/room
diff options
context:
space:
mode:
authorLeif Johansson <leifj@sunet.se>2011-10-12 01:00:37 +0200
committerLeif Johansson <leifj@sunet.se>2011-10-12 01:00:37 +0200
commitee95c0165446ad3d6546cba03bba0107ae10fb17 (patch)
tree4dfad3e496204099005aa0a653dcde94e821c384 /src/meetingtools/apps/room
parentf9496858d2cc52c83f28c235aa13bacd6e0d4afa (diff)
limit how often we import a room
Diffstat (limited to 'src/meetingtools/apps/room')
-rw-r--r--src/meetingtools/apps/room/views.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/meetingtools/apps/room/views.py b/src/meetingtools/apps/room/views.py
index 0ad535e..2140cc9 100644
--- a/src/meetingtools/apps/room/views.py
+++ b/src/meetingtools/apps/room/views.py
@@ -17,7 +17,8 @@ import logging
from pprint import pformat
from meetingtools.utils import session
import time
-from meetingtools.settings import GRACE, BASE_URL, DEFAULT_TEMPLATE_SCO
+from meetingtools.settings import GRACE, BASE_URL, DEFAULT_TEMPLATE_SCO,\
+ IMPORT_TTL
from django.utils.datetime_safe import datetime
from django.http import HttpResponseRedirect
from django.core.exceptions import ObjectDoesNotExist
@@ -245,6 +246,9 @@ def _import_room(request,acc,r):
if not room:
return None
+
+ if abs(room.lastupdated - time.time()) < IMPORT_TTL:
+ return room
api = ac_api_client(request,acc)
userlist = api.request('meeting-usermanager-user-list',{'sco-id': room.sco_id},False)