Skip to content
Snippets Groups Projects
Commit 44f26ec6 authored by Jonathan Weth's avatar Jonathan Weth :keyboard:
Browse files

Last event changes

parent 3348bae0
No related branches found
No related tags found
No related merge requests found
......@@ -246,7 +246,7 @@ class HeaderInformation:
self.affected_teachers) > 0 or len(self.affected_classes) > 0
def get_header_information(subs, date):
def get_header_information(subs, date, events=[]):
"""
Get header information like affected teachers/classes and missing teachers/classes for a given date
:param date: The date as datetime object
......@@ -267,6 +267,15 @@ def get_header_information(subs, date):
if _class not in info.affected_classes:
info.affected_classes.append(_class)
for event in events:
for teacher in event.teachers:
if teacher.id not in [x.id for x in info.affected_teachers]:
info.affected_teachers.append(teacher)
for _class in event.classes:
if _class.id not in [x.id for x in info.affected_classes]:
info.affected_classes.append(_class)
# Get all absences that are relevant for this day
info.absences = get_all_absences_by_date(date)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment