platform admins can toggle services from seeing letters

This commit is contained in:
Leo Hemsted
2016-10-26 16:56:51 +01:00
parent 4a7f136cab
commit 730719b61f
3 changed files with 15 additions and 3 deletions

View File

@@ -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))

View File

@@ -88,6 +88,7 @@ class ServiceAPIClient(NotificationsAPIClient):
'email_from',
'reply_to_email_address',
'research_mode',
'can_send_letters',
'sms_sender',
'created_by',
'branding',

View File

@@ -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>