Move service history into it own file

We’re going to do some work on this page, let’s put it in a sensible
place first before we add a bunch more code to the wrong place.
This commit is contained in:
Chris Hill-Scott
2019-10-18 09:18:51 +01:00
parent fe78d53643
commit fce0397b55
4 changed files with 24 additions and 17 deletions

View File

@@ -38,19 +38,6 @@ from app.utils import (
)
# This is a placeholder view method to be replaced
# when product team makes decision about how/what/when
# to view history
@main.route("/services/<service_id>/history")
@user_has_permissions()
def temp_service_history(service_id):
data = service_api_client.get_service_history(service_id)['data']
return render_template('views/temp-history.html',
services=data['service_history'],
api_keys=data['api_key_history'],
events=data['events'])
@main.route("/services/<service_id>/dashboard")
@user_has_permissions('view_activity', 'send_messages')
def old_service_dashboard(service_id):

19
app/main/views/history.py Normal file
View File

@@ -0,0 +1,19 @@
from flask import render_template
from app import service_api_client
from app.main import main
from app.utils import user_has_permissions
@main.route("/services/<service_id>/history")
@user_has_permissions('manage_service')
def history(service_id):
data = service_api_client.get_service_history(service_id)['data']
return render_template(
'views/temp-history.html',
services=data['service_history'],
api_keys=data['api_key_history'],
events=data['events']
)