mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-05-05 16:38:59 -04:00
Changed deactivate service to archive service.
need to deploy https://github.com/alphagov/notifications-api/pull/808 first
This commit is contained in:
@@ -186,12 +186,12 @@ def service_switch_can_send_letters(service_id):
|
||||
return redirect(url_for('.service_settings', service_id=service_id))
|
||||
|
||||
|
||||
@main.route("/services/<service_id>/service-settings/deactivate", methods=['GET', 'POST'])
|
||||
@main.route("/services/<service_id>/service-settings/archive", methods=['GET', 'POST'])
|
||||
@login_required
|
||||
@user_has_permissions('manage_settings', admin_override=True)
|
||||
def deactivate_service(service_id):
|
||||
def archive_service(service_id):
|
||||
if request.method == 'POST':
|
||||
service_api_client.deactivate_service(service_id)
|
||||
service_api_client.archive_service(service_id)
|
||||
return redirect(url_for('.service_settings', service_id=service_id))
|
||||
else:
|
||||
flash('There\'s no way to reverse this! Are you sure you want to archive this service?', 'delete')
|
||||
|
||||
@@ -103,8 +103,8 @@ class ServiceAPIClient(NotifyAdminAPIClient):
|
||||
def update_service_with_properties(self, service_id, properties):
|
||||
return self.update_service(service_id, **properties)
|
||||
|
||||
def deactivate_service(self, service_id):
|
||||
return self.post('/service/{}/deactivate'.format(service_id), data=None)
|
||||
def archive_service(self, service_id):
|
||||
return self.post('/service/{}/archive'.format(service_id), data=None)
|
||||
|
||||
def remove_user_from_service(self, service_id, user_id):
|
||||
"""
|
||||
|
||||
@@ -111,7 +111,7 @@
|
||||
</li>
|
||||
{% if current_service.active %}
|
||||
<li class="bottom-gutter">
|
||||
<a href="{{ url_for('.deactivate_service', service_id=current_service.id) }}" class="button">
|
||||
<a href="{{ url_for('.archive_service', service_id=current_service.id) }}" class="button">
|
||||
Archive service
|
||||
</a>
|
||||
</li>
|
||||
|
||||
Reference in New Issue
Block a user