From a96fdb3c6c44082dff9f9578bb292e24e0559cf3 Mon Sep 17 00:00:00 2001 From: Leif Johansson Date: Wed, 12 Oct 2011 00:44:07 +0200 Subject: room owner not requestor permissions --- src/meetingtools/apps/room/views.py | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/meetingtools/apps/room/views.py b/src/meetingtools/apps/room/views.py index 169cb1a..0ad535e 100644 --- a/src/meetingtools/apps/room/views.py +++ b/src/meetingtools/apps/room/views.py @@ -237,14 +237,8 @@ def _import_room(request,acc,r): modified = False room = None - if not r.has_key('name'): - return - try: room = Room.objects.get(sco_id=r['sco_id'],acc=acc) - if not room.name: - room.delete() - return except ObjectDoesNotExist: if r['folder_sco_id']: room = Room.objects.create(sco_id=r['sco_id'],acc=acc,creator=request.user,folder_sco_id=r['folder_sco_id']) @@ -274,6 +268,10 @@ def _import_room(request,acc,r): #logging.debug(pformat(room)) + if not room.name: + room.delete() + return None + if modified: logging.debug("saving ... %s" % pformat(room)) room.save() -- cgit v1.1