mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-08-20 14:29:51 -04:00
Munge stuff into a consistent event data type
We store our audit history in two ways: 1. A list of versions of a service 2. A list of events to do with API keys In the future there could be auditing data which we want to display that is stored in other formats (for example the event table). This commit adds some objects which wrap around the different types of auditing data, and expose a consistent interface to them. This architecture will let us: - write clean code in the presentation layer to display these events on a page - add more types of events in the future by subclassing the `Event` data type, without having to rewrite anything in the presentation layer
This commit is contained in:
@@ -1,6 +1,5 @@
|
||||
from flask import render_template
|
||||
|
||||
from app import current_service
|
||||
from app.main import main
|
||||
from app.utils import user_has_permissions
|
||||
|
||||
@@ -8,10 +7,4 @@ from app.utils import user_has_permissions
|
||||
@main.route("/services/<service_id>/history")
|
||||
@user_has_permissions('manage_service')
|
||||
def history(service_id):
|
||||
|
||||
return render_template(
|
||||
'views/temp-history.html',
|
||||
services=current_service.history['service_history'],
|
||||
api_keys=current_service.history['api_key_history'],
|
||||
events=current_service.history['events']
|
||||
)
|
||||
return render_template('views/temp-history.html')
|
||||
|
||||
Reference in New Issue
Block a user