Use model to toggle research mode

Just a nice bit of encapsulation, rather than passing `current_service`
through to a method on `current_service`.
This commit is contained in:
Chris Hill-Scott
2018-11-05 16:17:44 +00:00
parent 318f846630
commit 48b0d4194e
2 changed files with 6 additions and 3 deletions

View File

@@ -221,9 +221,7 @@ def service_switch_live(service_id):
@login_required
@user_is_platform_admin
def service_switch_research_mode(service_id):
current_service.update_with_properties(
{'research_mode': not current_service.research_mode}
)
current_service.toggle_research_mode()
return redirect(url_for('.service_settings', service_id=service_id))