remove unnecessary invocations of has_permissions(..., any_=True)

when added to a service, all users are given the view_activity
permission. So, if that's included in the list, we don't need `any_`,
and we don't need any of the other permissions.
This commit is contained in:
Leo Hemsted
2018-02-27 17:18:26 +00:00
parent 7ddad7c99e
commit bd54dbb40c
7 changed files with 9 additions and 39 deletions

View File

@@ -133,7 +133,7 @@ class UserApiClient(NotifyAdminAPIClient):
def get_count_of_users_with_permission(self, service_id, permission):
return len([
user for user in self.get_users_for_service(service_id)
if user.has_permissions(permission, any_=True)
if user.has_permissions(permission)
])
def get_users_for_organisation(self, org_id):