Fix broken audit links for normal users

This commit is contained in:
rubenwardy 2020-12-09 23:08:39 +00:00
parent 333dd60b32
commit 5fb01f01bf
3 changed files with 4 additions and 4 deletions

View File

@ -11,6 +11,6 @@ Audit Log
{% from "macros/audit_log.html" import render_audit_log %}
{{ render_pagination(pagination, url_set_query) }}
{{ render_audit_log(log) }}
{{ render_audit_log(log, current_user) }}
{{ render_pagination(pagination, url_set_query) }}
{% endblock %}

View File

@ -1,8 +1,8 @@
{% macro render_audit_log(log) -%}
{% macro render_audit_log(log, current_user) -%}
<div class="list-group mt-3">
{% for entry in log %}
<a class="list-group-item list-group-item-action"
{% if entry.description %}
{% if entry.description and current_user.rank.atLeast(current_user.rank.MODERATOR) %}
href="{{ url_for('admin.audit_view', id=entry.id) }}">
{% else %}
href="{{ entry.url }}">

View File

@ -66,7 +66,7 @@
<h3>{{ _("Recent Account Actions") }}</h3>
{% from "macros/audit_log.html" import render_audit_log %}
{{ render_audit_log(user.audit_log_entries.limit(10).all()) }}
{{ render_audit_log(user.audit_log_entries.limit(10).all(), current_user) }}
<h3>{{ _("Account Deletion and Deactivation") }}</h3>