Let inviting a user complete the go live checklist

At the moment you have to wait for whoever you’ve invited to accept the
invitation before you can go live. Since this check is mainly for the
benefit of the service, not us, we should trust that people’s intentions
are good when they invite someone.

So this commit also checks the invited users when counting how many team
members a service has.
This commit is contained in:
Chris Hill-Scott
2019-04-11 16:40:25 +01:00
parent e8b95f03c6
commit 116f36192f
4 changed files with 58 additions and 6 deletions

View File

@@ -112,8 +112,12 @@ class Service(JSONModel):
@cached_property
def has_team_members(self):
return user_api_client.get_count_of_users_with_permission(
self.id, 'manage_service'
return (
user_api_client.get_count_of_users_with_permission(
self.id, 'manage_service'
) + invite_api_client.get_count_of_invites_with_permission(
self.id, 'manage_service'
)
) > 1
def cancel_invite(self, invited_user_id):