1
0
Fork 0
forked from Fuji/Fuji

Handle missing subject in from_hebe_dict method by falling back to event name

This commit is contained in:
Maarceeli 2025-04-18 09:43:50 +02:00
parent 512fcf45f5
commit a62ebeac99

View file

@ -35,7 +35,7 @@ class Lesson(BaseModel):
room = data["Room"]["Code"], room = data["Room"]["Code"],
start = datetime.strptime(data["TimeSlot"]["Start"], "%H:%M").time(), start = datetime.strptime(data["TimeSlot"]["Start"], "%H:%M").time(),
end = datetime.strptime(data["TimeSlot"]["End"], "%H:%M").time(), end = datetime.strptime(data["TimeSlot"]["End"], "%H:%M").time(),
subject = data["Subject"]["Name"], subject = data["Subject"]["Name"] if data["Subject"] else data["Event"],
teacher = data["TeacherPrimary"]["DisplayName"], teacher = data["TeacherPrimary"]["DisplayName"],
group = data["Distribution"]["Shortcut"] if data["Distribution"] else None, group = data["Distribution"]["Shortcut"] if data["Distribution"] else None,
visible = data["Visible"], visible = data["Visible"],