Fix back links when viewing a broadcast

Where you go back to from a broadcast can now depend on whether it’s
a current or previous broadcast.
This commit is contained in:
Chris Hill-Scott
2020-10-15 13:18:23 +01:00
parent b54d49196b
commit d793d08ae7
2 changed files with 9 additions and 1 deletions

View File

@@ -295,6 +295,14 @@ def view_broadcast(service_id, broadcast_message_id):
return render_template(
'views/broadcast/view-message.html',
broadcast_message=broadcast_message,
back_link={
'main.view_current_broadcast': url_for(
'.broadcast_dashboard', service_id=current_service.id
),
'main.view_previous_broadcast': url_for(
'.broadcast_dashboard_previous', service_id=current_service.id
),
}[request.endpoint],
)