From 3faf92bfef2bcc32bceff60de4f6ba756d3e5542 Mon Sep 17 00:00:00 2001 From: Chris Hill-Scott Date: Mon, 3 Aug 2020 15:46:23 +0100 Subject: [PATCH] Go to broadcast, not dashboard after submitting MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Once you’ve created a broadcast you’re taken back to the dashboard. This feels too passive, and you might miss that the broadcast still needs approval. We should be much more explicit that you now need to find someone to approve your broadcast. Taking someone directly to the page for a broadcast lets us give more information about the status of the broadcast and what the next steps should be. --- app/main/views/broadcast.py | 3 ++- tests/app/main/views/test_broadcast.py | 8 +++++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/app/main/views/broadcast.py b/app/main/views/broadcast.py index f2f526dca..ff35b505d 100644 --- a/app/main/views/broadcast.py +++ b/app/main/views/broadcast.py @@ -169,8 +169,9 @@ def preview_broadcast_message(service_id, broadcast_message_id): if form.validate_on_submit(): broadcast_message.request_approval(until=form.finishes_at.data) return redirect(url_for( - '.broadcast_dashboard', + '.view_broadcast_message', service_id=current_service.id, + broadcast_message_id=broadcast_message.id, )) return render_template( diff --git a/tests/app/main/views/test_broadcast.py b/tests/app/main/views/test_broadcast.py index fb77212b8..72aa2a588 100644 --- a/tests/app/main/views/test_broadcast.py +++ b/tests/app/main/views/test_broadcast.py @@ -412,7 +412,13 @@ def test_start_broadcasting( broadcast_message_id=fake_uuid, _data={ 'finishes_at': end_time, - } + }, + _expected_redirect=url_for( + 'main.view_broadcast_message', + service_id=SERVICE_ONE_ID, + broadcast_message_id=fake_uuid, + _external=True, + ), ), mock_update_broadcast_message.assert_called_once_with( service_id=SERVICE_ONE_ID,