#101 Team sharing tests

* adds tests for team sharing
* extends the API for team sharing support
* adds shared_teams property shortcut for ShareableObjectMixin
* adds full support for team-based sharing to all views and functions
* simplifies ShareModalForm
* adds/updates translations
This commit is contained in:
2022-02-18 13:52:27 +01:00
parent 6dac847d22
commit aa675aa046
16 changed files with 278 additions and 133 deletions

View File

@@ -297,8 +297,9 @@ class ShareableTableFilterMixin(django_filters.FilterSet):
"""
if not value:
return queryset.filter(
users__in=[self.user], # requesting user has access
)
Q(users__in=[self.user]) | # requesting user has access
Q(teams__users__in=[self.user])
).distinct()
else:
return queryset