Skip to content
Snippets Groups Projects
Commit 9c7a3033 authored by Benjamin Hättasch's avatar Benjamin Hättasch
Browse files

Improve room import for virtual rooms

parent e38829cf
No related branches found
No related tags found
No related merge requests found
...@@ -598,13 +598,19 @@ class RoomBatchCreationView(EventSlugMixin, IntermediateAdminView): ...@@ -598,13 +598,19 @@ class RoomBatchCreationView(EventSlugMixin, IntermediateAdminView):
name = raw_room["name"] name = raw_room["name"]
location = raw_room["location"] if "location" in rooms_raw_dict.fieldnames else "" location = raw_room["location"] if "location" in rooms_raw_dict.fieldnames else ""
capacity = raw_room["capacity"] if "capacity" in rooms_raw_dict.fieldnames else -1 capacity = raw_room["capacity"] if "capacity" in rooms_raw_dict.fieldnames else -1
url = raw_room["url"] if "url" in rooms_raw_dict.fieldnames else ""
try: try:
if VIRTUAL_ROOMS_SUPPORT and url != "": if VIRTUAL_ROOMS_SUPPORT and "url" in rooms_raw_dict.fieldnames:
VirtualRoom.objects.create(name=name, location=location, capacity=capacity, url=url, event=self.event) VirtualRoom.objects.create(name=name,
location=location,
capacity=capacity,
url=raw_room["url"],
event=self.event)
else: else:
Room.objects.create(name=name, location=location, capacity=capacity, event=self.event) Room.objects.create(name=name,
location=location,
capacity=capacity,
event=self.event)
created_count += 1 created_count += 1
except django.db.Error as e: except django.db.Error as e:
messages.add_message(self.request, messages.WARNING, messages.add_message(self.request, messages.WARNING,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment