Skip to content

Commit

Permalink
Handle exceptions during teacher conversion
Browse files Browse the repository at this point in the history
  • Loading branch information
BelKed committed Feb 8, 2024
1 parent 95672b5 commit 1477e77
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion edupage_api/foreign_timetables.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,12 @@ def classroom_by_id(id: str):

classes = [int(id) for id in skeleton.get("classids")]
groups = skeleton.get("groupnames")
teachers = [teacher_by_id(int(id)) for id in skeleton.get("teacherids")]

try:
teachers = [teacher_by_id(int(id)) for id in skeleton.get("teacherids")]
except:
teachers = []

classrooms = [classroom_by_id(id) for id in skeleton.get("classroomids")]

duration = (skeleton.get("durationperiods")
Expand Down

0 comments on commit 1477e77

Please sign in to comment.