diff options
-rw-r--r-- | src/meetingtools/apps/room/views.py | 10 |
1 files 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() |