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)
This commit is contained in:
mpeltriaux 2022-05-31 12:58:35 +02:00
parent 8b6c8dc1aa
commit 2e68d7bbcb
2 changed files with 2 additions and 2 deletions

View File

@ -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

View File

@ -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