Skip to content
Snippets Groups Projects
Verified Commit f989d5c9 authored by Jonathan Weth's avatar Jonathan Weth :keyboard: Committed by Nik | Klampfradler
Browse files

Add distincts to absence query set to prevent double entries

(cherry picked from commit 528e23f0)
parent a60129d2
No related branches found
No related tags found
No related merge requests found
......@@ -15,6 +15,7 @@ Fixed
* Fix migration names and dependencies
* 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