From 8b67df76173397eb2a5f42baa7ebf339aa65273a Mon Sep 17 00:00:00 2001 From: mpeltriaux Date: Tue, 31 May 2022 12:58:35 +0200 Subject: [PATCH] HOTFIX: Team sharing * fixes bug where entries would show up on index views as they would be shared (are shared but using a 'deleted' Team, which still exists on the db) --- compensation/filters.py | 2 +- konova/filters/mixins.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/compensation/filters.py b/compensation/filters.py index b6377092..c9bf9b70 100644 --- a/compensation/filters.py +++ b/compensation/filters.py @@ -60,7 +60,7 @@ class CheckboxCompensationTableFilter(CheckboxTableFilter): if not value: return queryset.filter( Q(intervention__users__in=[self.user]) | # requesting user has access - Q(intervention__teams__users__in=[self.user]) + Q(intervention__teams__in=self.user.shared_teams) ).distinct() else: return queryset diff --git a/konova/filters/mixins.py b/konova/filters/mixins.py index beb44dac..cfd9cc4c 100644 --- a/konova/filters/mixins.py +++ b/konova/filters/mixins.py @@ -305,7 +305,7 @@ class ShareableTableFilterMixin(django_filters.FilterSet): if not value: return queryset.filter( Q(users__in=[self.user]) | # requesting user has access - Q(teams__users__in=[self.user]) + Q(teams__in=self.user.shared_teams) ).distinct() else: return queryset