mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-08-18 13:39:41 -04:00
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:
@@ -163,6 +163,7 @@ def submit_request_to_go_live(service_id):
|
||||
'\nText messages in next year: {volume_sms}'
|
||||
'\nLetters in next year: {volume_letter}'
|
||||
'\nConsent to research: {research_consent}'
|
||||
'\nOther live services: {existing_live}'
|
||||
'\n'
|
||||
'\n---'
|
||||
'\n'
|
||||
@@ -189,6 +190,7 @@ def submit_request_to_go_live(service_id):
|
||||
volume_letter=form.volume_letter.data,
|
||||
volume_letter_normalised=form.volume_letter.data.replace(',', ''),
|
||||
research_consent=form.research_consent.data.title(),
|
||||
existing_live='Yes' if user_api_client.user_has_live_services(current_user) else 'No',
|
||||
service_id=current_service.id,
|
||||
organisation=AgreementInfo.from_current_user().owner,
|
||||
user_name=current_user.name,
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user