Skip to content
Snippets Groups Projects
Commit e8cd2598 authored by codecraft's avatar codecraft :crocodile:
Browse files

make query for absence faster by using select_related

parent 02111677
No related branches found
No related tags found
1 merge request!47Resolve "Use select_related in absence list"
Pipeline #193538 failed
...@@ -67,7 +67,7 @@ class AbsenceType(PermissionsTypeMixin, DjangoFilterMixin, DjangoObjectType): ...@@ -67,7 +67,7 @@ class AbsenceType(PermissionsTypeMixin, DjangoFilterMixin, DjangoObjectType):
@classmethod @classmethod
def get_queryset(cls, queryset, info): def get_queryset(cls, queryset, info):
return get_objects_for_user(info.context.user, "kolego.view_absence", queryset) return get_objects_for_user(info.context.user, "kolego.view_absence", queryset).select_related("person", "reason");
class AbsenceBatchCreateMutation(BaseBatchCreateMutation): class AbsenceBatchCreateMutation(BaseBatchCreateMutation):
......
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