mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-08-25 08:44:23 -04:00
Make service live and revert working, all tests passing.
This commit is contained in:
@@ -96,6 +96,23 @@ def service_request_to_go_live(service_id):
|
||||
return redirect(url_for('.service_settings', service_id=service_id))
|
||||
|
||||
|
||||
@main.route("/services/<service_id>/service-settings/switch-live")
|
||||
@login_required
|
||||
@user_has_permissions(admin_override=True)
|
||||
def service_switch_live(service_id):
|
||||
service_api_client.update_service(
|
||||
current_service['id'],
|
||||
current_service['name'],
|
||||
current_service['active'],
|
||||
# TODO This limit should be set depending on the agreement signed by
|
||||
# with Notify.
|
||||
25000 if current_service['restricted'] else 50,
|
||||
False if current_service['restricted'] else True,
|
||||
current_service['users'],
|
||||
current_service['email_from'])
|
||||
return redirect(url_for('.service_settings', service_id=service_id))
|
||||
|
||||
|
||||
@main.route("/services/<service_id>/service-settings/status", methods=['GET', 'POST'])
|
||||
@login_required
|
||||
@user_has_permissions('manage_settings', admin_override=True)
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
'title': 'Request to go live and turn off sending restrictions',
|
||||
'link': url_for('.service_request_to_go_live', service_id=current_service.id),
|
||||
'hint': 'A live service can send notifications to any phone number or email address',
|
||||
} if not current_service.live else {
|
||||
} if current_service.restricted else {
|
||||
},
|
||||
{
|
||||
'title': 'Temporarily suspend API keys',
|
||||
@@ -27,7 +27,15 @@
|
||||
} if not current_service.active else {
|
||||
'title': 'Reactivate API keys',
|
||||
'link': url_for('.service_status_change', service_id=current_service.id)
|
||||
}
|
||||
},
|
||||
{
|
||||
'title': 'Make service live',
|
||||
'link': url_for('.service_switch_live', service_id=current_service.id)
|
||||
} if current_service.restricted and current_user.has_permissions([], admin_override=True) else {
|
||||
'title': 'Revert service to trial',
|
||||
'link': url_for('.service_switch_live', service_id=current_service.id)
|
||||
} if not current_service.restricted and current_user.has_permissions([], admin_override=True) else {
|
||||
},
|
||||
]) }}
|
||||
|
||||
{% endblock %}
|
||||
|
||||
Reference in New Issue
Block a user