mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-02-05 10:53:28 -05:00
Move request to go live notes into template
We can make the `as_agreement_statement_for_go_live_request` method less complex by offloading some of the content it returns to the presentation layer.
This commit is contained in:
@@ -103,9 +103,9 @@ class Organisation(JSONModel):
|
||||
|
||||
def as_agreement_statement_for_go_live_request(self, fallback_domain):
|
||||
if self.agreement_signed:
|
||||
agreement_statement = 'Yes, on behalf of {}.'.format(self.name)
|
||||
elif self.name:
|
||||
agreement_statement = '{} (organisation is {}, {}).'.format(
|
||||
return 'Yes, on behalf of {}.'.format(self.name)
|
||||
if self.name:
|
||||
return '{} (organisation is {}, {}).'.format(
|
||||
{
|
||||
False: 'No',
|
||||
None: 'Can’t tell',
|
||||
@@ -117,13 +117,7 @@ class Organisation(JSONModel):
|
||||
None: 'crown status unknown',
|
||||
}.get(self.crown),
|
||||
)
|
||||
else:
|
||||
agreement_statement = 'Can’t tell (domain is {}).'.format(fallback_domain)
|
||||
|
||||
if self.request_to_go_live_notes:
|
||||
agreement_statement = agreement_statement + ' ' + self.request_to_go_live_notes
|
||||
|
||||
return agreement_statement
|
||||
return 'Can’t tell (domain is {}).'.format(fallback_domain)
|
||||
|
||||
def as_info_for_branding_request(self, fallback_domain):
|
||||
return self.name or 'Can’t tell (domain is {})'.format(fallback_domain)
|
||||
|
||||
@@ -4,6 +4,7 @@ Service: {{ current_service.name }}
|
||||
---
|
||||
Organisation type: {{ current_service.organisation_type_label }}
|
||||
Agreement signed: {{ current_service.organisation.as_agreement_statement_for_go_live_request(current_user.email_domain) }}
|
||||
{%- if current_service.organisation.request_to_go_live_notes %} {{ current_service.organisation.request_to_go_live_notes }}{% endif %}
|
||||
{%- if current_service.organisation.agreement_signed_by %}
|
||||
Agreement signed by: {{ current_service.organisation.agreement_signed_by.email_address }}
|
||||
{% endif -%}
|
||||
|
||||
Reference in New Issue
Block a user