Skip to content

Commit 9f0b8d0

Browse files
fix: Fatal Server Error when creating room in video component (#1409)
1 parent 9a0cbb4 commit 9f0b8d0

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

app/eventyay/base/services/event.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -274,6 +274,8 @@ def _create_room(data, with_channel=False, permission_preset="public", creator=N
274274
channel = None
275275
if with_channel:
276276
channel = Channel.objects.create(event_id=room.event_id, room=room)
277+
# Pre-warm the channel relationship to avoid lazy-loading issues during serialization
278+
room.channel = channel
277279

278280
AuditLog.objects.create(
279281
event_id=room.event_id,
@@ -360,6 +362,8 @@ async def create_room(event, data, creator):
360362

361363
async def get_room_config_for_user(room: str, event_id: str, user):
362364
room = await get_room(id=room, event_id=event_id)
365+
if room is None:
366+
return None
363367
permissions = await database_sync_to_async(room.event.get_all_permissions)(user)
364368
return get_room_config(room, permissions[room] | permissions[room.event])
365369

app/eventyay/features/live/modules/room.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -329,6 +329,9 @@ async def push_room_info(self, body):
329329
conf = await get_room_config_for_user(
330330
body["room"], self.consumer.event.id, self.consumer.user
331331
)
332+
if conf is None:
333+
# Room not found or not yet available, skip broadcasting
334+
return
332335
if "room:view" not in conf["permissions"]:
333336
return
334337
await self.consumer.send_json(
@@ -434,6 +437,9 @@ async def push_schedule_data(self, body):
434437
config = await get_room_config_for_user(
435438
body["room"], self.consumer.event.id, self.consumer.user
436439
)
440+
if config is None:
441+
# Room not found or not yet available, skip broadcasting
442+
return
437443
if "room:view" not in config["permissions"]:
438444
return
439445
await self.consumer.send_json(

0 commit comments

Comments
 (0)