Update web/core/views.py
This commit is contained in:
parent
6d5828d156
commit
e331e9e4a2
@ -24,6 +24,7 @@ from .utils import terms, has_wildcards, wildcard_to_regex, import_csv_bytes
|
||||
from django.contrib.staticfiles.storage import staticfiles_storage
|
||||
from django.db import transaction
|
||||
from . import utils as core_utils
|
||||
from .models_audit import AuditLog
|
||||
|
||||
|
||||
# Order + labels used in the Search UI
|
||||
@ -1040,3 +1041,12 @@ def clear_history(request):
|
||||
request.session.modified = True
|
||||
|
||||
return JsonResponse({"ok": True})
|
||||
|
||||
|
||||
is_superuser = user_passes_test(lambda u: u.is_superuser)
|
||||
|
||||
@is_superuser
|
||||
@login_required
|
||||
def audit_log(request):
|
||||
rows = AuditLog.objects.all().order_by("-timestamp")[:100]
|
||||
return render(request, "tools/audit_log.html", {"rows": rows})
|
||||
Loading…
Reference in New Issue
Block a user