From c7d6809412e50372804d0af37e1e389101f62414 Mon Sep 17 00:00:00 2001
From: HanseGucker <joniweth@gmx.de>
Date: Sun, 17 Mar 2019 15:20:20 +0100
Subject: [PATCH] Show missing teachers (absences) in the header PDF

---
 biscuit/apps/chronos/views.py | 16 ++++++++++++----
 1 file changed, 12 insertions(+), 4 deletions(-)

diff --git a/biscuit/apps/chronos/views.py b/biscuit/apps/chronos/views.py
index 2389adc3..d75cedb4 100755
--- a/biscuit/apps/chronos/views.py
+++ b/biscuit/apps/chronos/views.py
@@ -185,16 +185,24 @@ def sub_pdf(request):
 
     # Get the next weekday
     today = timezone.datetime.now()
-    first_day = get_next_weekday(today)
+    date = get_next_weekday(today)
+
 
     # Get subs and generate table
-    subs = get_substitutions_by_date(first_day)
+    subs = get_substitutions_by_date(date)
     sub_table = generate_sub_table(subs)
-    header_info = get_header_information(subs)
+    header_info = get_header_information(subs, date)
     print(header_info.affected_teachers)
 
+    # print("HI")
+    # print(absences, len(absences))
+    # for absence in absences:
+    #     print(absence.from_date)
+    #     print(absence.to_date)
+    #     print(absence.teacher, "\n")
+    #
     # Generate LaTeX
-    tex = generate_class_tex(sub_table, first_day, header_info)
+    tex = generate_class_tex(sub_table, date, header_info)
 
     # Generate PDF
     generate_pdf(tex, "class")
-- 
GitLab