Skip to content

Commit

Permalink
fix(backend): only return employments and worktime-balances once (#406)
Browse files Browse the repository at this point in the history
before this employments and worktime-balances were returned an additional time for each supervisor.
  • Loading branch information
c0rydoras authored Aug 13, 2024
1 parent 1dc9d15 commit be835c2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions backend/timed/employment/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ def get_queryset(self):
if not user.is_superuser:
queryset = queryset.filter(Q(id=user.id) | Q(supervisors=user))

return queryset
return queryset.distinct()


class AbsenceBalanceViewSet(AggregateQuerysetMixin, ReadOnlyModelViewSet):
Expand Down Expand Up @@ -346,7 +346,7 @@ def get_queryset(self) -> QuerySet[models.Employment]:
if not user.is_superuser:
queryset = queryset.filter(Q(user=user) | Q(user__supervisors=user))

return queryset
return queryset.distinct()


class LocationViewSet(ReadOnlyModelViewSet):
Expand Down

0 comments on commit be835c2

Please sign in to comment.