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

Add distincts to absence query set to prevent double entries

parent 509a8522
No related branches found
No related tags found
1 merge request!178Resolve "Show abbreviations in the substitution plan only once"
Pipeline #15418 passed
......@@ -14,6 +14,7 @@ Fixed
* Migration path was ambigious
* Unique constraints for breaks and substitutions were too tight
* Absences in substitutions list were displayed multiple times.
`2.0b0`_ - 2021-05-21
---------------------
......
......@@ -600,13 +600,13 @@ class AbsenceQuerySet(DateRangeQuerySetMixin, SchoolTermRelatedQuerySet):
"""QuerySet with custom query methods for absences."""
def absent_teachers(self):
return Person.objects.filter(absences__in=self).order_by("short_name")
return Person.objects.filter(absences__in=self).distinct().order_by("short_name")
def absent_groups(self):
return Group.objects.filter(absences__in=self).order_by("short_name")
return Group.objects.filter(absences__in=self).distinct().order_by("short_name")
def absent_rooms(self):
return Person.objects.filter(absences__in=self).order_by("short_name")
return Person.objects.filter(absences__in=self).distinct().order_by("short_name")
class HolidayQuerySet(QuerySet, DateRangeQuerySetMixin):
......
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