Skip to content

Commit

Permalink
fixed no teacher error
Browse files Browse the repository at this point in the history
  • Loading branch information
JonasJoKuJonas committed Oct 27, 2024
1 parent b7cc152 commit 013b74c
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions custom_components/webuntis/notify.py
Original file line number Diff line number Diff line change
Expand Up @@ -234,9 +234,11 @@ def get_changes(change, lesson, lesson_old, server):
else:
name = lesson["subjects"][0]["name"]

changes["subject"] = get_lesson_name_str(
server=server, name=name, teacher=lesson["teachers"][0]["name"]
)
teacher = None
if "teachers" not in server.exclude_data:
teacher = lesson["teachers"][0]["name"]

changes["subject"] = get_lesson_name_str(server=server, name=name, teacher=teacher)

changes["date"] = lesson["start"].strftime("%d.%m.%Y")
changes["time_start"] = lesson["start"].strftime("%H:%M")
Expand Down

0 comments on commit 013b74c

Please sign in to comment.