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
Pipeline #119469 passed
......@@ -598,13 +598,19 @@ class RoomBatchCreationView(EventSlugMixin, IntermediateAdminView):
name = raw_room["name"]
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
url = raw_room["url"] if "url" in rooms_raw_dict.fieldnames else ""
try:
if VIRTUAL_ROOMS_SUPPORT and url != "":
VirtualRoom.objects.create(name=name, location=location, capacity=capacity, url=url, event=self.event)
if VIRTUAL_ROOMS_SUPPORT and "url" in rooms_raw_dict.fieldnames:
VirtualRoom.objects.create(name=name,
location=location,
capacity=capacity,
url=raw_room["url"],
event=self.event)
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
except django.db.Error as e:
messages.add_message(self.request, messages.WARNING,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment