diff --git a/app/config.py b/app/config.py index 7a2412e5e..2543c7a99 100644 --- a/app/config.py +++ b/app/config.py @@ -87,6 +87,7 @@ class Config(object): r"bl\.uk", r"stfc\.ac\.uk", r"wmfs\.net", + r"bbsrc\.ac\.uk", ] LOGO_UPLOAD_BUCKET_NAME = 'public-logos-local' diff --git a/app/main/forms.py b/app/main/forms.py index 1bdbb2ba6..74356b0a5 100644 --- a/app/main/forms.py +++ b/app/main/forms.py @@ -511,7 +511,8 @@ class ServiceBrandingOrg(Form): choices=[ ('govuk', 'GOV.UK only'), ('both', 'GOV.UK and organisation'), - ('org', 'Organisation only') + ('org', 'Organisation only'), + ('org_banner', 'Organisation banner') ], validators=[ DataRequired() diff --git a/app/main/views/api_keys.py b/app/main/views/api_keys.py index ba6a83a18..68a93f8d2 100644 --- a/app/main/views/api_keys.py +++ b/app/main/views/api_keys.py @@ -13,11 +13,7 @@ from app.notify_client.api_key_api_client import KEY_TYPE_NORMAL, KEY_TYPE_TEST, def api_integration(service_id): return render_template( 'views/api/index.html', - api_notifications=notification_api_client.get_notifications_for_service( - service_id=service_id, - include_jobs=False, - include_from_test_key=True - ) + api_notifications=notification_api_client.get_api_notifications_for_service(service_id) ) diff --git a/app/main/views/organisations.py b/app/main/views/organisations.py index 0fe976752..c7d41a38e 100644 --- a/app/main/views/organisations.py +++ b/app/main/views/organisations.py @@ -71,7 +71,9 @@ def manage_org(logo=None): return redirect( url_for('.manage_org', logo=upload_filename)) - logo = persist_logo(logo, session["user_id"]) + if logo: + logo = persist_logo(logo, session["user_id"]) + delete_temp_files_created_by(session["user_id"]) if org: diff --git a/app/notify_client/notification_api_client.py b/app/notify_client/notification_api_client.py index f39ff33d0..cec5346cc 100644 --- a/app/notify_client/notification_api_client.py +++ b/app/notify_client/notification_api_client.py @@ -66,3 +66,14 @@ class NotificationApiClient(NotifyAdminAPIClient): def get_notification(self, service_id, notification_id): return self.get(url='/service/{}/notifications/{}'.format(service_id, notification_id)) + + def get_api_notifications_for_service(self, service_id): + ret = self.get_notifications_for_service(service_id, include_jobs=False, include_from_test_key=True) + return self.map_letters_to_accepted(ret) + + @staticmethod + def map_letters_to_accepted(notifications): + for notification in notifications['notifications']: + if notification['notification_type'] == 'letter' and notification['status'] in ('created', 'sending'): + notification['status'] = 'accepted' + return notifications diff --git a/app/templates/components/page-footer.html b/app/templates/components/page-footer.html index 74b847a0c..5dcc69e4f 100644 --- a/app/templates/components/page-footer.html +++ b/app/templates/components/page-footer.html @@ -6,13 +6,12 @@ secondary_link=False, secondary_link_text=None, delete_link=False, - delete_link_text="delete", - button_disabled=False + delete_link_text="delete" ) %}