From f0402236469fb4c9ab98c153eb400200f869fd0c Mon Sep 17 00:00:00 2001 From: Jens Langhammer Date: Tue, 30 Jun 2020 10:23:54 +0200 Subject: [PATCH] audit: move events list from admin to audit app --- passbook/admin/urls.py | 3 --- .../administration => audit/templates}/audit/list.html | 0 passbook/audit/urls.py | 9 ++++++++- passbook/{admin/views/audit.py => audit/views.py} | 2 +- passbook/core/templates/base/page.html | 4 ++-- 5 files changed, 11 insertions(+), 7 deletions(-) rename passbook/{admin/templates/administration => audit/templates}/audit/list.html (100%) rename passbook/{admin/views/audit.py => audit/views.py} (87%) diff --git a/passbook/admin/urls.py b/passbook/admin/urls.py index c1a7f824a..56a7603a6 100644 --- a/passbook/admin/urls.py +++ b/passbook/admin/urls.py @@ -3,7 +3,6 @@ from django.urls import path from passbook.admin.views import ( applications, - audit, certificate_key_pair, debug, flows, @@ -252,8 +251,6 @@ urlpatterns = [ certificate_key_pair.CertificateKeyPairDeleteView.as_view(), name="certificatekeypair-delete", ), - # Audit Log - path("audit/", audit.EventListView.as_view(), name="audit-log"), # Groups path("groups/", groups.GroupListView.as_view(), name="groups"), # Debug diff --git a/passbook/admin/templates/administration/audit/list.html b/passbook/audit/templates/audit/list.html similarity index 100% rename from passbook/admin/templates/administration/audit/list.html rename to passbook/audit/templates/audit/list.html diff --git a/passbook/audit/urls.py b/passbook/audit/urls.py index f7327b0ac..83be4fe29 100644 --- a/passbook/audit/urls.py +++ b/passbook/audit/urls.py @@ -1,2 +1,9 @@ """passbook audit urls""" -urlpatterns = [] +from django.urls import path + +from passbook.audit.views import EventListView + +urlpatterns = [ + # Audit Log + path("audit/", EventListView.as_view(), name="log"), +] diff --git a/passbook/admin/views/audit.py b/passbook/audit/views.py similarity index 87% rename from passbook/admin/views/audit.py rename to passbook/audit/views.py index 56b274c8f..90599db49 100644 --- a/passbook/admin/views/audit.py +++ b/passbook/audit/views.py @@ -9,7 +9,7 @@ class EventListView(PermissionListMixin, ListView): """Show list of all invitations""" model = Event - template_name = "administration/audit/list.html" + template_name = "audit/list.html" permission_required = "passbook_audit.view_event" ordering = "-created" paginate_by = 20 diff --git a/passbook/core/templates/base/page.html b/passbook/core/templates/base/page.html index f3fea0fd7..9b918451f 100644 --- a/passbook/core/templates/base/page.html +++ b/passbook/core/templates/base/page.html @@ -32,8 +32,8 @@ {% if user.is_superuser %}
  • {% trans 'Administrate' %}
  • -
  • {% trans 'Monitor' %}
  • +
  • {% trans 'Monitor' %}
  • {% endif %}