diff --git a/compensation/filters/compensation.py b/compensation/filters/compensation.py index aa1c967b..899fd132 100644 --- a/compensation/filters/compensation.py +++ b/compensation/filters/compensation.py @@ -55,10 +55,12 @@ class CheckboxCompensationTableFilter(CheckboxTableFilter): """ if not value: - return queryset.filter( + user_teams = self.user.shared_teams + result = queryset.filter( Q(intervention__users__in=[self.user]) | # requesting user has access - Q(intervention__teams__in=self.user.shared_teams) + Q(intervention__teams__in=user_teams) ).distinct() + return result else: return queryset diff --git a/konova/filters/mixins/share.py b/konova/filters/mixins/share.py index 0c94bdc9..598f75fb 100644 --- a/konova/filters/mixins/share.py +++ b/konova/filters/mixins/share.py @@ -50,9 +50,11 @@ class ShareableTableFilterMixin(django_filters.FilterSet): """ if not value: - return queryset.filter( + user_teams = self.user.shared_teams + result = queryset.filter( Q(users__in=[self.user]) | # requesting user has access - Q(teams__in=self.user.shared_teams) + Q(teams__in=user_teams) ).distinct() + return result else: return queryset \ No newline at end of file