diff options
author | Johan Lundberg <lundberg@nordu.net> | 2014-03-28 14:49:46 +0100 |
---|---|---|
committer | Johan Lundberg <lundberg@nordu.net> | 2014-03-28 14:49:46 +0100 |
commit | 5f0b20b7624576dd312382436ae23b4047c4c08c (patch) | |
tree | d264c5a8d28856533b4dfff764447e6deca2f970 /meetingtools/apps/stats | |
parent | b143524a6290ad4e52388cbb55ee4d7ec871264d (diff) |
Stop processing UserMeetingTransactions if status != completed.
Diffstat (limited to 'meetingtools/apps/stats')
-rw-r--r-- | meetingtools/apps/stats/tasks.py | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/meetingtools/apps/stats/tasks.py b/meetingtools/apps/stats/tasks.py index 9e2f437..1d379e2 100644 --- a/meetingtools/apps/stats/tasks.py +++ b/meetingtools/apps/stats/tasks.py @@ -28,14 +28,15 @@ def import_acc_sessions(acc,since=0,room_last_visited=False): for tx in r.et.findall(".//row"): try: tx = UserMeetingTransaction.create(acc,tx) - if room_last_visited: - rooms = Room.objects.filter(sco=tx.sco) - if len(rooms) == 1: - room = rooms[0] - if room.lastvisited is None or room.lastvisited < tx.date_closed: - room.lastvisited = tx.date_created - room.save() - nr += 1 + if tx: + if room_last_visited: + rooms = Room.objects.filter(sco=tx.sco) + if len(rooms) == 1: + room = rooms[0] + if room.lastvisited is None or room.lastvisited < tx.date_closed: + room.lastvisited = tx.date_created + room.save() + nr += 1 except Exception,ex: logging.error(ex) ne += 1 |