mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-08-23 15:57:23 -04:00
Merge pull request #1941 from alphagov/rtgl-org-info
Add what we know of agreements to go live request
This commit is contained in:
@@ -53,6 +53,8 @@ innovateuk.gov.uk:
|
||||
ncsc.gov.uk:
|
||||
owner: National Cyber Security Center
|
||||
agreement_signed: true
|
||||
nhs.net:
|
||||
owner: NHS
|
||||
nhsdigital.nhs.uk: digital.nhs.uk
|
||||
digital.nhs.uk:
|
||||
owner: NHS Digital
|
||||
|
||||
@@ -44,6 +44,7 @@ from app.main.forms import (
|
||||
SMSPrefixForm,
|
||||
)
|
||||
from app.utils import (
|
||||
GovernmentDomain,
|
||||
email_safe,
|
||||
get_cdn_domain,
|
||||
user_has_permissions,
|
||||
@@ -196,6 +197,7 @@ def submit_request_to_go_live(service_id):
|
||||
'On behalf of {} ({})\n'
|
||||
'\n---'
|
||||
'\nOrganisation type: {}'
|
||||
'\nAgreement signed: {}'
|
||||
'\nMOU in place: {}'
|
||||
'\nChannel: {}\nStart date: {}\nStart volume: {}'
|
||||
'\nPeak volume: {}'
|
||||
@@ -204,6 +206,7 @@ def submit_request_to_go_live(service_id):
|
||||
current_service['name'],
|
||||
url_for('main.service_dashboard', service_id=current_service['id'], _external=True),
|
||||
current_service['organisation_type'],
|
||||
GovernmentDomain.from_current_user().as_human_readable,
|
||||
form.mou.data,
|
||||
formatted_list(filter(None, (
|
||||
'email' if form.channel_email.data else None,
|
||||
|
||||
28
app/utils.py
28
app/utils.py
@@ -462,6 +462,34 @@ class GovernmentDomain:
|
||||
self.agreement_signed
|
||||
) = self._get_details_of_domain()
|
||||
|
||||
@classmethod
|
||||
def from_user(cls, user):
|
||||
return cls(user.email_address if user.is_authenticated else '')
|
||||
|
||||
@classmethod
|
||||
def from_current_user(cls):
|
||||
return cls.from_user(current_user)
|
||||
|
||||
@property
|
||||
def as_human_readable(self):
|
||||
if self.agreement_signed:
|
||||
return 'Yes, on behalf of {}'.format(self.owner)
|
||||
elif self.owner:
|
||||
return '{} (organisation is {}, {})'.format(
|
||||
{
|
||||
False: 'No',
|
||||
None: 'Can’t tell',
|
||||
}.get(self.agreement_signed),
|
||||
self.owner,
|
||||
{
|
||||
True: 'a crown body',
|
||||
False: 'a non-crown body',
|
||||
None: 'crown status unknown',
|
||||
}.get(self.crown_status),
|
||||
)
|
||||
else:
|
||||
return 'Can’t tell'
|
||||
|
||||
@staticmethod
|
||||
def get_matching_function(email_address_or_domain):
|
||||
|
||||
|
||||
Reference in New Issue
Block a user