summaryrefslogtreecommitdiff
path: root/src/meetingtools/apps
diff options
context:
space:
mode:
Diffstat (limited to 'src/meetingtools/apps')
-rw-r--r--src/meetingtools/apps/room/models.py6
-rw-r--r--src/meetingtools/apps/room/views.py6
2 files changed, 8 insertions, 4 deletions
diff --git a/src/meetingtools/apps/room/models.py b/src/meetingtools/apps/room/models.py
index a71e608..00f54b4 100644
--- a/src/meetingtools/apps/room/models.py
+++ b/src/meetingtools/apps/room/models.py
@@ -40,4 +40,10 @@ class Room(models.Model):
else:
return int(time.mktime(self.lastvisited.timetuple())*1000)
+ def nusers(self):
+ if not self.user_count:
+ return "unknown"
+ else:
+ return self.user_count
+
tagging.register(Room) \ No newline at end of file
diff --git a/src/meetingtools/apps/room/views.py b/src/meetingtools/apps/room/views.py
index 201509e..c77f81d 100644
--- a/src/meetingtools/apps/room/views.py
+++ b/src/meetingtools/apps/room/views.py
@@ -330,13 +330,11 @@ def go_by_path(request,path):
def goto(request,room):
api = ac_api_client(request, room.acc)
session_info = api.request('report-meeting-sessions',{'sco-id':room.sco_id})
-
now = time.time()
+ room.user_count = _nusers(session_info)
if room.self_cleaning:
- nusers = _nusers(session_info)
- if (nusers == 0) and (abs(room.lastvisit() - now) > GRACE):
+ if (room.user_count == 0) and (abs(room.lastvisit() - now) > GRACE):
room = _clean(request,room)
- room.user_count = nusers
room.lastvisited = datetime.now()
room.save()