Merge branch 'master' into develop

This commit is contained in:
Agate 2020-06-05 11:37:21 +02:00
commit 50bf5c8c1d
No known key found for this signature in database
GPG Key ID: 6B501DFD73514E14
2 changed files with 4 additions and 0 deletions

View File

@ -202,6 +202,9 @@ class ActorScopeFilter(filters.CharFilter):
return queryset.none()
return queryset.filter(**{self.actor_field: actor})
elif value.lower().startswith("domain:"):
domain = value.split("domain:", 1)[1]
return queryset.filter(**{"{}__domain_id".format(self.actor_field): domain})
else:
return queryset.none()

View File

@ -52,6 +52,7 @@ def test_mutation_filter_is_approved(value, expected, factories):
("noop", 2, []),
("actor:actor1@domain.test", 0, [0]),
("actor:actor2@domain.test", 0, [1]),
("domain:domain.test", 0, [0, 1]),
],
)
def test_actor_scope_filter(