1
0
Fork 0
forked from Fuji/Fuji

Fix timetable error when Room is null

This commit is contained in:
mily 2025-04-18 23:44:34 +02:00
parent 1866f61b05
commit daa2126756

View file

@ -32,7 +32,7 @@ class Lesson(BaseModel):
return Lesson(
position = data["TimeSlot"]["Position"],
date = datetime.fromtimestamp(data["Date"]["Timestamp"] / 1000).date(),
room = data["Room"]["Code"],
room = data["Room"]["Code"] if data.get("Room") else None,
start = datetime.strptime(data["TimeSlot"]["Start"], "%H:%M").time(),
end = datetime.strptime(data["TimeSlot"]["End"], "%H:%M").time(),
subject = data["Subject"]["Name"] if data["Subject"] else data["Event"],