Fix timetable error when Room is null
This commit is contained in:
parent
437c5ec17b
commit
2fe24aecf1
1 changed files with 1 additions and 1 deletions
|
@ -32,7 +32,7 @@ class Lesson(BaseModel):
|
||||||
return Lesson(
|
return Lesson(
|
||||||
position = data["TimeSlot"]["Position"],
|
position = data["TimeSlot"]["Position"],
|
||||||
date = datetime.fromtimestamp(data["Date"]["Timestamp"] / 1000).date(),
|
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(),
|
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"] if data["Subject"] else data["Event"],
|
subject = data["Subject"]["Name"] if data["Subject"] else data["Event"],
|
||||||
|
|
Loading…
Add table
Reference in a new issue