Remove redundant force_overrride feature

This is no longer needed as all areas data has now been migrated.
This commit is contained in:
Ben Thorner
2021-09-06 09:53:39 +01:00
parent 3779146cc5
commit 6af39c4d3b
2 changed files with 2 additions and 11 deletions

View File

@@ -156,15 +156,11 @@ def create_broadcast_message(service_id):
@broadcast_message_blueprint.route('/<uuid:broadcast_message_id>', methods=['POST'])
def update_broadcast_message(service_id, broadcast_message_id):
data = request.get_json()
# TEMPORARY: while we migrate and backfill "areas"
force_override = data.pop("force_override", False)
validate(data, update_broadcast_message_schema)
broadcast_message = dao_get_broadcast_message_by_id_and_service_id(broadcast_message_id, service_id)
if not force_override and broadcast_message.status not in BroadcastStatusType.PRE_BROADCAST_STATUSES:
if broadcast_message.status not in BroadcastStatusType.PRE_BROADCAST_STATUSES:
raise InvalidRequest(
f'Cannot update broadcast_message {broadcast_message.id} while it has status {broadcast_message.status}',
status_code=400

View File

@@ -415,10 +415,6 @@ def test_update_broadcast_message_allows_edit_while_not_yet_live(
assert response['updated_at'] is not None
@pytest.mark.parametrize('force_override', [
False,
pytest.param(True, marks=pytest.mark.xfail)
])
@pytest.mark.parametrize('status', [
BroadcastStatusType.BROADCASTING,
BroadcastStatusType.CANCELLED,
@@ -426,7 +422,6 @@ def test_update_broadcast_message_allows_edit_while_not_yet_live(
BroadcastStatusType.TECHNICAL_FAILURE,
])
def test_update_broadcast_message_doesnt_allow_edits_after_broadcast_goes_live(
force_override,
admin_request,
sample_broadcast_service,
status
@@ -436,7 +431,7 @@ def test_update_broadcast_message_doesnt_allow_edits_after_broadcast_goes_live(
response = admin_request.post(
'broadcast_message.update_broadcast_message',
_data={'force_override': force_override, 'areas': {'ids': ['london', 'glasgow']}},
_data={'areas': {'ids': ['london', 'glasgow']}},
service_id=t.service_id,
broadcast_message_id=bm.id,
_expected_status=400