diff options
author | Leif Johansson <leifj@sunet.se> | 2011-05-05 16:34:03 +0200 |
---|---|---|
committer | Leif Johansson <leifj@sunet.se> | 2011-05-05 16:34:03 +0200 |
commit | a003daecdcd26b2bd83aba860549341fd0bd0c9b (patch) | |
tree | 038c96eb642caf6cc545dfc3e0465650cff06278 /src/meetingtools/apps | |
parent | 9be00e843656f203df5361c7b12503b8d59592aa (diff) |
remove orphaned rooms before import
Diffstat (limited to 'src/meetingtools/apps')
-rw-r--r-- | src/meetingtools/apps/room/views.py | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/meetingtools/apps/room/views.py b/src/meetingtools/apps/room/views.py index 250e48e..2dd620f 100644 --- a/src/meetingtools/apps/room/views.py +++ b/src/meetingtools/apps/room/views.py @@ -272,16 +272,17 @@ def list(request): ar = [] for (sco_id,name,source_sco_id,urlpath) in user_rooms: - logging.debug("%s %s %s %s" % (sco_id,name,source_sco_id,urlpath)) - room = _import_room(request,acc,sco_id,source_sco_id,my_meetings_sco_id,name,urlpath) ar.append(int(sco_id)) - #logging.debug(pformat(ar)) - for r in Room.objects.filter(creator=request.user).all(): #logging.debug(pformat(r)) if (not r.sco_id in ar): # and (not r.self_cleaning): #XXX this logic isn't right! r.delete() + + for (sco_id,name,source_sco_id,urlpath) in user_rooms: + logging.debug("%s %s %s %s" % (sco_id,name,source_sco_id,urlpath)) + room = _import_room(request,acc,sco_id,source_sco_id,my_meetings_sco_id,name,urlpath) + return respond_to(request,{'text/html':'apps/room/list.html'},{'user':request.user,'rooms':Room.objects.filter(creator=request.user).all()}) def rooms_by_group(request,group): |