mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-05-06 17:09:00 -04:00
platform admins can toggle services from seeing letters
This commit is contained in:
@@ -168,7 +168,18 @@ def service_switch_live(service_id):
|
||||
def service_switch_research_mode(service_id):
|
||||
service_api_client.update_service_with_properties(
|
||||
service_id,
|
||||
{"research_mode": False if current_service['research_mode'] else True}
|
||||
{"research_mode": not current_service['research_mode']}
|
||||
)
|
||||
return redirect(url_for('.service_settings', service_id=service_id))
|
||||
|
||||
|
||||
@main.route("/services/<service_id>/service-settings/can-send-letters")
|
||||
@login_required
|
||||
@user_has_permissions(admin_override=True)
|
||||
def service_switch_can_send_letters(service_id):
|
||||
service_api_client.update_service_with_properties(
|
||||
service_id,
|
||||
{"can_send_letters": not current_service['can_send_letters']}
|
||||
)
|
||||
return redirect(url_for('.service_settings', service_id=service_id))
|
||||
|
||||
|
||||
@@ -88,6 +88,7 @@ class ServiceAPIClient(NotificationsAPIClient):
|
||||
'email_from',
|
||||
'reply_to_email_address',
|
||||
'research_mode',
|
||||
'can_send_letters',
|
||||
'sms_sender',
|
||||
'created_by',
|
||||
'branding',
|
||||
|
||||
@@ -88,12 +88,12 @@
|
||||
{{ 'Make service live' if current_service.restricted else 'Revert service to trial mode' }}
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<li class="bottom-gutter">
|
||||
<a href="{{ url_for('.service_switch_research_mode', service_id=current_service.id) }}" class="button">
|
||||
{{ 'Take service out of research mode' if current_service.research_mode else 'Put into research mode' }}
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<li class="bottom-gutter">
|
||||
<a href="{{ url_for('.service_switch_can_send_letters', service_id=current_service.id) }}" class="button">
|
||||
{{ 'Stop sending letters' if current_service.can_send_letters else 'Allow to send letters' }}
|
||||
</a>
|
||||
|
||||
Reference in New Issue
Block a user