From a003daecdcd26b2bd83aba860549341fd0bd0c9b Mon Sep 17 00:00:00 2001 From: Leif Johansson Date: Thu, 5 May 2011 16:34:03 +0200 Subject: remove orphaned rooms before import --- src/meetingtools/apps/room/views.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'src/meetingtools/apps') 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): -- cgit v1.1