fix: convert DB models to view models in bulk-status endpoint

model_validate(from_attributes=True) needed to convert DB Meeting and
CalendarEvent to their view-layer Pydantic counterparts.
This commit is contained in:
Igor Loskutov
2026-02-05 21:56:45 -05:00
parent ae44f5227b
commit cdc495499b

View File

@@ -239,7 +239,9 @@ async def rooms_bulk_meeting_status(
m.platform = room.platform
if user_id != room.user_id and m.platform == "whereby":
m.host_room_url = ""
active_by_room[room.name].append(m)
active_by_room[room.name].append(
Meeting.model_validate(m, from_attributes=True)
)
upcoming_by_room: dict[str, list[CalendarEventResponse]] = defaultdict(list)
for e in upcoming_events:
@@ -249,7 +251,9 @@ async def rooms_bulk_meeting_status(
if user_id != room.user_id:
e.description = None
e.attendees = None
upcoming_by_room[room.name].append(e)
upcoming_by_room[room.name].append(
CalendarEventResponse.model_validate(e, from_attributes=True)
)
result: dict[str, RoomMeetingStatus] = {}
for name in request.room_names: