From 30824b110c947048af258b95e6e45435c576699b Mon Sep 17 00:00:00 2001 From: Katie Smith Date: Mon, 13 Dec 2021 08:47:26 +0000 Subject: [PATCH] Fix billing page to show correct user who signed MOU If the organisation table contains an entry for `agreement_signed_by_id` and for `agreement_signed_on_behalf_of_name` then we should the person who signed the MOU as being the `agreement_signed_on_behalf_of_name`. This was wrongly showing the `agreement_signed_by_id` as the person who signed the agreement. --- app/templates/views/organisations/organisation/billing.html | 2 +- tests/app/main/views/organisations/test_organisations.py | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/app/templates/views/organisations/organisation/billing.html b/app/templates/views/organisations/organisation/billing.html index 5c272fef1..7bcb0263e 100644 --- a/app/templates/views/organisations/organisation/billing.html +++ b/app/templates/views/organisations/organisation/billing.html @@ -19,7 +19,7 @@ and financial agreement on {{ current_org.agreement_signed_at | format_date_normal }}.

- {{ current_org.agreement_signed_by.name or current_org.agreement_signed_on_behalf_of_name }} signed the agreement + {{ current_org.agreement_signed_on_behalf_of_name or current_org.agreement_signed_by.name }} signed the agreement on behalf of {{ current_org.name}}.

diff --git a/tests/app/main/views/organisations/test_organisations.py b/tests/app/main/views/organisations/test_organisations.py index c39ec2f46..561155800 100644 --- a/tests/app/main/views/organisations/test_organisations.py +++ b/tests/app/main/views/organisations/test_organisations.py @@ -1600,6 +1600,7 @@ def test_organisation_billing_page_not_accessible_if_not_platform_admin( @pytest.mark.parametrize('signed_by_id, signed_by_name, expected_signatory', [ ('1234', None, 'Test User'), (None, 'The Org Manager', 'The Org Manager'), + ('1234', 'The Org Manager', 'The Org Manager'), ]) def test_organisation_billing_page_when_the_agreement_is_signed_by_a_known_person( organisation_one,