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

Fix detection of the end of the validity ranges list in next_lessons

parent 96817b2a
No related branches found
No related tags found
No related merge requests found
Pipeline #17508 canceled
...@@ -21,6 +21,7 @@ Fixed ...@@ -21,6 +21,7 @@ Fixed
user language (fixed by using gettext_lazy). user language (fixed by using gettext_lazy).
* Affected groups and persons in substitutions list were displayed multiple times. * Affected groups and persons in substitutions list were displayed multiple times.
* ``lessons_on_day`` didn't work as expected if a person has no lessons. * ``lessons_on_day`` didn't work as expected if a person has no lessons.
* End of validity ranges list wasn't detected correctly in ``next_lesson``.
`2.0b2` - 2021-06-02 `2.0b2` - 2021-06-02
-------------------- --------------------
......
...@@ -465,7 +465,7 @@ class LessonDataQuerySet(models.QuerySet, WeekQuerySetMixin): ...@@ -465,7 +465,7 @@ class LessonDataQuerySet(models.QuerySet, WeekQuerySetMixin):
# If date of next lesson period is out of validity range (larger) ... # If date of next lesson period is out of validity range (larger) ...
elif next_lesson_period_date > next_lesson_period.lesson.validity.date_end: elif next_lesson_period_date > next_lesson_period.lesson.validity.date_end:
# ... we have to get the lesson period from the next validity range # ... we have to get the lesson period from the next validity range
if validity_index >= len(validity_ranges): if validity_index >= len(validity_ranges) - 1:
# There are no validity ranges (and thus no lessons) # There are no validity ranges (and thus no lessons)
# in the school term after this lesson period # in the school term after this lesson period
return None return None
......
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