Skip to content

Commit

Permalink
ical improve no current_teachers display
Browse files Browse the repository at this point in the history
(cherry picked from commit dab7eb1)
  • Loading branch information
Belissimo-T committed Aug 11, 2024
1 parent c8f3c1a commit 394d3da
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions endpoints/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -229,10 +229,14 @@ def generate_html_list(elements: list[str]) -> str:
subject = lesson["current_class"] if lesson["current_class"] is not None else "-"

if lesson["takes_place"]:
teacher = ", ".join(lesson["current_teachers"]) if lesson["current_teachers"] else "-"
if not lesson["current_teachers"] and lesson["scheduled_teachers"]:
teacher = ", ".join(lesson["scheduled_teachers"]) if lesson["scheduled_teachers"] else "-"
teacher = f"({teacher})"
else:
teacher = ", ".join(lesson["current_teachers"]) if lesson["current_teachers"] else "-"
teacher = teacher if not lesson["teacher_changed"] else f"[{teacher}]"

subject_ = subject if not lesson["subject_changed"] else f"[{subject}]"
teacher = teacher if not lesson["teacher_changed"] else f"[{teacher}]"

summary = f"{subject_} {teacher}"
else:
Expand Down

0 comments on commit 394d3da

Please sign in to comment.