From 7a5a3b640b10d3a1b163b6ff0c75141ea37823cc Mon Sep 17 00:00:00 2001 From: Jonathan Weth <git@jonathanweth.de> Date: Mon, 27 Apr 2020 15:18:04 +0200 Subject: [PATCH] Fix timetable builder: Return None if person has no lessons --- aleksis/apps/chronos/util/build.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/aleksis/apps/chronos/util/build.py b/aleksis/apps/chronos/util/build.py index 5a8ebfe8..6b3668cb 100644 --- a/aleksis/apps/chronos/util/build.py +++ b/aleksis/apps/chronos/util/build.py @@ -53,6 +53,9 @@ def build_timetable( is_person = True type_ = obj.timetable_type + if type_ is None: + return None + # Get matching holidays if is_person: holiday = Holiday.on_day(date_ref) -- GitLab