From fde8d818688c4a7b1836c7bab98999e36b314b2a Mon Sep 17 00:00:00 2001 From: Leo Hemsted Date: Mon, 15 Aug 2016 11:00:20 +0100 Subject: [PATCH] send organisation back in correct variable --- app/main/views/service_settings.py | 2 +- app/notify_client/service_api_client.py | 2 +- tests/app/main/views/test_service_settings.py | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/app/main/views/service_settings.py b/app/main/views/service_settings.py index 503fc9497..a49af5924 100644 --- a/app/main/views/service_settings.py +++ b/app/main/views/service_settings.py @@ -283,7 +283,7 @@ def service_set_branding_and_org(service_id): service_api_client.update_service( service_id, branding=form.branding_type.data, - organisation_id=organisation + organisation=organisation ) return redirect(url_for('.service_settings', service_id=service_id)) diff --git a/app/notify_client/service_api_client.py b/app/notify_client/service_api_client.py index 65ad34a50..0e67f28ca 100644 --- a/app/notify_client/service_api_client.py +++ b/app/notify_client/service_api_client.py @@ -92,7 +92,7 @@ class ServiceAPIClient(NotificationsAPIClient): 'sms_sender', 'created_by', 'branding', - 'organisation_id' + 'organisation' } if disallowed_attributes: raise TypeError('Not allowed to update service attributes: {}'.format( diff --git a/tests/app/main/views/test_service_settings.py b/tests/app/main/views/test_service_settings.py index 4aa7e2b2f..c527365b4 100644 --- a/tests/app/main/views/test_service_settings.py +++ b/tests/app/main/views/test_service_settings.py @@ -782,9 +782,9 @@ def test_should_show_branding_and_organisations( page.find('input', attrs={"id": "branding_type-2"})['checked'] assert page.find('label', attrs={"for": "organisation-1"}).text.strip() == 'None' - with pytest.raises(KeyError): - page.find('input', attrs={"id": "organisation-1"})['value'] + assert page.find('input', attrs={"id": "organisation-1"})['value'] == 'None' assert page.find('label', attrs={"for": "organisation-2"}).text.strip() == 'Organisation name' + assert page.find('input', attrs={"id": "organisation-2"})['value'] == 'organisation-name' assert page.find('label', attrs={"for": "organisation-2"}).find('img')['src'] == ( '/static/images/email-template/crests/example.png' )