Move ‘agreement signed’ message into Jinja

Human readable content like this doesn’t really belong in the model
layer, it’s more natural to have it in the presentation layer.
This commit is contained in:
Chris Hill-Scott
2021-10-11 15:09:07 +01:00
parent 1ab83c48e3
commit d76dacc41e
2 changed files with 4 additions and 2 deletions

View File

@@ -102,8 +102,6 @@ class Organisation(JSONModel):
self.email_branding_id = None
def as_agreement_statement_for_go_live_request(self, fallback_domain):
if self.agreement_signed:
return 'Yes, on behalf of {}.'.format(self.name)
if self.name:
return '{} (organisation is {}, {}).'.format(
{

View File

@@ -3,7 +3,11 @@ 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) }}
{%- 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 %}
Agreement signed by: {{ current_service.organisation.agreement_signed_by.email_address }}