mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-09-11 02:23:19 -04:00
Merge pull request #3712 from alphagov/go-live-once
Stop live services requesting to go live
This commit is contained in:
@@ -187,6 +187,9 @@ def estimate_usage(service_id):
|
||||
@main.route("/services/<uuid:service_id>/service-settings/request-to-go-live", methods=['GET'])
|
||||
@user_has_permissions('manage_service')
|
||||
def request_to_go_live(service_id):
|
||||
if current_service.live:
|
||||
return render_template('views/service-settings/service-already-live.html')
|
||||
|
||||
return render_template(
|
||||
'views/service-settings/request-to-go-live.html'
|
||||
)
|
||||
|
||||
@@ -0,0 +1,28 @@
|
||||
{% extends "withnav_template.html" %}
|
||||
{% from "components/page-header.html" import page_header %}
|
||||
|
||||
{% block service_page_title %}
|
||||
Your service is already live
|
||||
{% endblock %}
|
||||
|
||||
{% block maincolumn_content %}
|
||||
<div class="govuk-grid-row">
|
||||
<div class="govuk-grid-column-full">
|
||||
{{ page_header('Your service is already live') }}
|
||||
|
||||
<p class="govuk-body">
|
||||
{% if current_service.go_live_at %}
|
||||
‘{{ current_service.name }}’ went live on {{ current_service.go_live_at | format_date_normal }}.
|
||||
{% else %}
|
||||
‘{{ current_service.name }}’ is already live.
|
||||
{% endif %}
|
||||
</p>
|
||||
|
||||
<p class="govuk-body">
|
||||
<a class="govuk-link govuk-link--no-visited-state" href="{{ url_for('.choose_account') }}">Switch service</a>
|
||||
if you want to make a different service live.
|
||||
</p>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
@@ -1037,6 +1037,28 @@ def test_should_not_show_go_live_button_if_checklist_not_complete(
|
||||
)
|
||||
|
||||
|
||||
@pytest.mark.parametrize('go_live_at, message', [
|
||||
(None, '‘service one’ is already live.'),
|
||||
('2020-10-09 13:55:20', '‘service one’ went live on 9 October 2020.'),
|
||||
])
|
||||
def test_request_to_go_live_redirects_if_service_already_live(
|
||||
client_request,
|
||||
service_one,
|
||||
go_live_at,
|
||||
message,
|
||||
):
|
||||
service_one['restricted'] = False
|
||||
service_one['go_live_at'] = go_live_at
|
||||
|
||||
page = client_request.get(
|
||||
'main.request_to_go_live',
|
||||
service_id=SERVICE_ONE_ID,
|
||||
)
|
||||
|
||||
assert page.h1.text == 'Your service is already live'
|
||||
assert normalize_spaces(page.select_one('main p').text) == message
|
||||
|
||||
|
||||
@pytest.mark.parametrize((
|
||||
'estimated_sms_volume,'
|
||||
'organisation_type,'
|
||||
|
||||
Reference in New Issue
Block a user