mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-09-06 18:08:25 -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):
|
def service_switch_research_mode(service_id):
|
||||||
service_api_client.update_service_with_properties(
|
service_api_client.update_service_with_properties(
|
||||||
service_id,
|
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))
|
return redirect(url_for('.service_settings', service_id=service_id))
|
||||||
|
|
||||||
|
|||||||
@@ -88,6 +88,7 @@ class ServiceAPIClient(NotificationsAPIClient):
|
|||||||
'email_from',
|
'email_from',
|
||||||
'reply_to_email_address',
|
'reply_to_email_address',
|
||||||
'research_mode',
|
'research_mode',
|
||||||
|
'can_send_letters',
|
||||||
'sms_sender',
|
'sms_sender',
|
||||||
'created_by',
|
'created_by',
|
||||||
'branding',
|
'branding',
|
||||||
|
|||||||
@@ -88,12 +88,12 @@
|
|||||||
{{ 'Make service live' if current_service.restricted else 'Revert service to trial mode' }}
|
{{ 'Make service live' if current_service.restricted else 'Revert service to trial mode' }}
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li class="bottom-gutter">
|
||||||
<a href="{{ url_for('.service_switch_research_mode', service_id=current_service.id) }}" class="button">
|
<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' }}
|
{{ 'Take service out of research mode' if current_service.research_mode else 'Put into research mode' }}
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li class="bottom-gutter">
|
||||||
<a href="{{ url_for('.service_switch_can_send_letters', service_id=current_service.id) }}" class="button">
|
<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' }}
|
{{ 'Stop sending letters' if current_service.can_send_letters else 'Allow to send letters' }}
|
||||||
</a>
|
</a>
|
||||||
|
|||||||
Reference in New Issue
Block a user