Note existing live services in go live ticket

It’s useful for analysing our growth to know if someone who’s requesting
to go live is already a live user of Notify.
This commit is contained in:
Chris Hill-Scott
2018-12-12 12:22:38 +00:00
parent 3cb0b164e8
commit 688bdd1d7a
3 changed files with 9 additions and 0 deletions

View File

@@ -219,6 +219,11 @@ class UserApiClient(NotifyAdminAPIClient):
), [])
return sorted(all_services, key=lambda service: service['name'])
def user_has_live_services(self, user):
return not all(
service['restricted'] for service in self.get_services_for_user(user)
)
def get_service_ids_for_user(self, user):
return {
service['id'] for service in self.get_services_for_user(user)