Skip to content

Commit

Permalink
fix(backend/credits): don't return the same credit multiple times (#402)
Browse files Browse the repository at this point in the history
  • Loading branch information
c0rydoras authored Aug 13, 2024
1 parent 6c37332 commit 5416817
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 @@ -436,7 +436,7 @@ def get_queryset(self) -> QuerySet[models.AbsenceCredit]:
if not user.is_superuser:
queryset = queryset.filter(Q(user=user) | Q(user__supervisors=user))

return queryset
return queryset.distinct()


class OvertimeCreditViewSet(ModelViewSet):
Expand Down Expand Up @@ -468,4 +468,4 @@ def get_queryset(self) -> QuerySet[models.OvertimeCredit]:
if not user.is_superuser:
queryset = queryset.filter(Q(user=user) | Q(user__supervisors=user))

return queryset
return queryset.distinct()

0 comments on commit 5416817

Please sign in to comment.