mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-08-25 00:33:58 -04:00
Merge pull request #2157 from alphagov/fix-branding-request-org-info
Fix org info in branding requests with known orgs
This commit is contained in:
@@ -986,7 +986,7 @@ def branding_request(service_id):
|
|||||||
'\n---'
|
'\n---'
|
||||||
'\nBranding requested: {}'
|
'\nBranding requested: {}'
|
||||||
).format(
|
).format(
|
||||||
AgreementInfo.from_current_user().as_human_readable,
|
AgreementInfo.from_current_user().as_info_for_branding_request,
|
||||||
current_service['name'],
|
current_service['name'],
|
||||||
url_for('main.service_dashboard', service_id=current_service['id'], _external=True),
|
url_for('main.service_dashboard', service_id=current_service['id'], _external=True),
|
||||||
branding_options_dict[form.options.data],
|
branding_options_dict[form.options.data],
|
||||||
|
|||||||
@@ -473,6 +473,10 @@ class AgreementInfo:
|
|||||||
else:
|
else:
|
||||||
return 'Can’t tell (domain is {})'.format(self._domain)
|
return 'Can’t tell (domain is {})'.format(self._domain)
|
||||||
|
|
||||||
|
@property
|
||||||
|
def as_info_for_branding_request(self):
|
||||||
|
return self.owner or 'Can’t tell (domain is {})'.format(self._domain)
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def as_jinja_template(self):
|
def as_jinja_template(self):
|
||||||
if self.crown_status is None:
|
if self.crown_status is None:
|
||||||
|
|||||||
@@ -454,6 +454,16 @@ def test_get_valid_government_domain_gets_most_specific_first():
|
|||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
def test_get_domain_info_for_branding_request():
|
||||||
|
|
||||||
|
assert AgreementInfo("gov.uk").as_info_for_branding_request == (
|
||||||
|
'Can’t tell (domain is gov.uk)'
|
||||||
|
)
|
||||||
|
assert AgreementInfo("dacorum.gov.uk").as_info_for_branding_request == (
|
||||||
|
'Dacorum Borough Council'
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
def test_validate_government_domain_data():
|
def test_validate_government_domain_data():
|
||||||
|
|
||||||
for domain in AgreementInfo.domains.keys():
|
for domain in AgreementInfo.domains.keys():
|
||||||
|
|||||||
Reference in New Issue
Block a user