diff --git a/app/models/organisation.py b/app/models/organisation.py index f789dff23..7d91aa84d 100644 --- a/app/models/organisation.py +++ b/app/models/organisation.py @@ -101,21 +101,20 @@ class Organisation(JSONModel): self.request_to_go_live_notes = None self.email_branding_id = None - def as_agreement_statement_for_go_live_request(self, fallback_domain): - if self.name: - return '{} (organisation is {}, {}).'.format( - { - False: 'No', - None: 'Can’t tell', - }.get(self.agreement_signed), - self.name, - { - True: 'a crown body', - False: 'a non-crown body', - None: 'crown status unknown', - }.get(self.crown), - ) - return 'Can’t tell (domain is {}).'.format(fallback_domain) + @property + def as_agreement_statement_for_go_live_request(self): + return '{} (organisation is {}, {}).'.format( + { + False: 'No', + None: 'Can’t tell', + }.get(self.agreement_signed), + self.name, + { + True: 'a crown body', + False: 'a non-crown body', + None: 'crown status unknown', + }.get(self.crown), + ) def as_info_for_branding_request(self, fallback_domain): return self.name or 'Can’t tell (domain is {})'.format(fallback_domain) diff --git a/app/templates/go-live-request.txt b/app/templates/go-live-request.txt index 124a397b1..ce70e8d68 100644 --- a/app/templates/go-live-request.txt +++ b/app/templates/go-live-request.txt @@ -3,10 +3,10 @@ Service: {{ current_service.name }} --- Organisation type: {{ current_service.organisation_type_label }} -{% if current_service.organisation.agreement_signed -%} -Agreement signed: Yes, on behalf of {{ current_service.organisation.name }}. -{%- else -%} -Agreement signed: {{ current_service.organisation.as_agreement_statement_for_go_live_request(current_user.email_domain) }} +Agreement signed: +{%- if current_service.organisation.agreement_signed %} Yes, on behalf of {{ current_service.organisation.name }}. +{%- elif current_service.organisation.name %} {{ current_service.organisation.as_agreement_statement_for_go_live_request }} +{%- else %} Can’t tell (domain is {{ current_user.email_domain }}). {%- endif %} {%- 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 %}