Skip to content
Snippets Groups Projects
Commit 32cd07ae authored by Julian's avatar Julian
Browse files

Fix managers in alsijil

parent 54329c85
No related branches found
No related tags found
1 merge request!392Resolve "Absence creation form should support datetimes"
...@@ -11,7 +11,7 @@ from django.utils.translation import gettext as _ ...@@ -11,7 +11,7 @@ from django.utils.translation import gettext as _
from calendarweek import CalendarWeek from calendarweek import CalendarWeek
from aleksis.apps.chronos.managers import DateRangeQuerySetMixin from aleksis.apps.chronos.managers import DateRangeQuerySetMixin
from aleksis.core.managers import AlekSISBaseManagerWithoutMigrations, PolymorphicBaseManager from aleksis.core.managers import AlekSISBaseManagerWithoutMigrations, RecurrencePolymorphicManager
if TYPE_CHECKING: if TYPE_CHECKING:
from aleksis.core.models import Group from aleksis.core.models import Group
...@@ -189,7 +189,7 @@ class GroupRoleAssignmentQuerySet(DateRangeQuerySetMixin, QuerySet): ...@@ -189,7 +189,7 @@ class GroupRoleAssignmentQuerySet(DateRangeQuerySetMixin, QuerySet):
return self.filter(Q(groups=group) | Q(groups__child_groups=group)) return self.filter(Q(groups=group) | Q(groups__child_groups=group))
class DocumentationManager(PolymorphicBaseManager): class DocumentationManager(RecurrencePolymorphicManager):
"""Manager adding specific methods to documentations.""" """Manager adding specific methods to documentations."""
def get_queryset(self): def get_queryset(self):
...@@ -205,9 +205,11 @@ class DocumentationManager(PolymorphicBaseManager): ...@@ -205,9 +205,11 @@ class DocumentationManager(PolymorphicBaseManager):
) )
class ParticipationStatusManager(PolymorphicBaseManager): class ParticipationStatusManager(RecurrencePolymorphicManager):
"""Manager adding specific methods to participation statuses.""" """Manager adding specific methods to participation statuses."""
def get_queryset(self): def get_queryset(self):
"""Ensure often used related data are loaded as well.""" """Ensure often used related data are loaded as well."""
return super().get_queryset().select_related("person", "absence_reason", "base_absence") # return super().get_queryset().select_related("person", "absence_reason", "base_absence")
# TODO: `Field ParticipationStatus.person cannot be both deferred and traversed using select_related at the same time.`
return super().get_queryset()
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