mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-08-24 08:16:51 -04:00
Merge pull request #3650 from alphagov/broadcast-org-always-on
Broadcast org always on
This commit is contained in:
@@ -84,7 +84,8 @@ class Config(object):
|
|||||||
ASSET_DOMAIN = ''
|
ASSET_DOMAIN = ''
|
||||||
ASSET_PATH = '/static/'
|
ASSET_PATH = '/static/'
|
||||||
|
|
||||||
BROADCAST_ORGANISATION_ID = os.environ.get('BROADCAST_ORGANISATION_ID')
|
# as defined in api db migration 0331_add_broadcast_org.py
|
||||||
|
BROADCAST_ORGANISATION_ID = '38e4bf69-93b0-445d-acee-53ea53fe02df'
|
||||||
|
|
||||||
NOTIFY_SERVICE_ID = 'd6aa2c68-a2d9-4437-ab19-3ae8eb202553'
|
NOTIFY_SERVICE_ID = 'd6aa2c68-a2d9-4437-ab19-3ae8eb202553'
|
||||||
|
|
||||||
@@ -179,8 +180,6 @@ class Live(Config):
|
|||||||
ASSET_DOMAIN = 'static.notifications.service.gov.uk'
|
ASSET_DOMAIN = 'static.notifications.service.gov.uk'
|
||||||
ASSET_PATH = 'https://static.notifications.service.gov.uk/'
|
ASSET_PATH = 'https://static.notifications.service.gov.uk/'
|
||||||
|
|
||||||
BROADCAST_ORGANISATION_ID = '38e4bf69-93b0-445d-acee-53ea53fe02df'
|
|
||||||
|
|
||||||
|
|
||||||
class CloudFoundryConfig(Config):
|
class CloudFoundryConfig(Config):
|
||||||
pass
|
pass
|
||||||
|
|||||||
@@ -104,11 +104,10 @@ class Service(JSONModel):
|
|||||||
set(self.permissions) - {'email', 'sms', 'letter'} | {'broadcast'}
|
set(self.permissions) - {'email', 'sms', 'letter'} | {'broadcast'}
|
||||||
)
|
)
|
||||||
broadcast_org_id = current_app.config['BROADCAST_ORGANISATION_ID']
|
broadcast_org_id = current_app.config['BROADCAST_ORGANISATION_ID']
|
||||||
if broadcast_org_id:
|
organisations_client.update_service_organisation(
|
||||||
organisations_client.update_service_organisation(
|
service_id=self.id,
|
||||||
service_id=self.id,
|
org_id=broadcast_org_id
|
||||||
org_id=broadcast_org_id
|
)
|
||||||
)
|
|
||||||
return ret
|
return ret
|
||||||
|
|
||||||
def update_permissions(self, permissions):
|
def update_permissions(self, permissions):
|
||||||
|
|||||||
@@ -93,6 +93,7 @@ def test_service_set_permission(
|
|||||||
platform_admin_client,
|
platform_admin_client,
|
||||||
service_one,
|
service_one,
|
||||||
mock_get_inbound_number_for_service,
|
mock_get_inbound_number_for_service,
|
||||||
|
mock_update_service_organisation,
|
||||||
permission,
|
permission,
|
||||||
initial_permissions,
|
initial_permissions,
|
||||||
form_data,
|
form_data,
|
||||||
@@ -235,18 +236,3 @@ def test_setting_broadcast_sets_organisation_if_config_value_set(
|
|||||||
service_id=SERVICE_ONE_ID,
|
service_id=SERVICE_ONE_ID,
|
||||||
org_id=fake_uuid
|
org_id=fake_uuid
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
def test_setting_broadcast_doesnt_set_organisation_if_config_value_not_set(
|
|
||||||
mock_update_service_organisation,
|
|
||||||
mock_update_service,
|
|
||||||
platform_admin_client,
|
|
||||||
):
|
|
||||||
with set_config(platform_admin_client.application, 'BROADCAST_ORGANISATION_ID', None):
|
|
||||||
response = platform_admin_client.post(
|
|
||||||
url_for('main.service_set_permission', service_id=SERVICE_ONE_ID, permission='broadcast'),
|
|
||||||
data={'enabled': True}
|
|
||||||
)
|
|
||||||
assert response.status_code == 302
|
|
||||||
assert response.location == url_for('main.service_settings', service_id=SERVICE_ONE_ID, _external=True)
|
|
||||||
assert not mock_update_service_organisation.called
|
|
||||||
|
|||||||
Reference in New Issue
Block a user