Fix crash in releases list due to missing current_user argument

This commit is contained in:
rubenwardy 2021-07-24 16:47:41 +01:00
parent 4e83adc032
commit 5a12b9e6c4
3 changed files with 38 additions and 40 deletions

@ -24,7 +24,7 @@
{% endmacro %}
{% macro render_releases_download(releases, package) %}
{% macro render_releases_download(releases, package, current_user) %}
{% for rel in releases %}
{% if rel.approved or package.checkPerm(current_user, "MAKE_RELEASE") or rel.checkPerm(current_user, "APPROVE_RELEASE") %}
<a class="list-group-item list-group-item-action" href="{{ rel.getDownloadURL() }}">
@ -54,7 +54,6 @@
{% macro render_releases(releases, package, current_user) -%}
{% for rel in releases %}
{% if rel.approved or package.checkPerm(current_user, "MAKE_RELEASE") or rel.checkPerm(current_user, "APPROVE_RELEASE") %}
<div class="list-group-item">
<a class="btn btn-sm btn-primary float-right" href="{{ rel.getEditURL() }}">Edit
{% if not rel.task_id and not rel.approved and rel.checkPerm(current_user, "APPROVE_RELEASE") %}
@ -95,7 +94,6 @@
{% if not rel.approved %}</i>{% endif %}
</div>
{% endif %}
{% else %}
<div class="list-group-item">No releases available.</div>
{% endfor %}

@ -38,7 +38,7 @@
{% if package.checkPerm(current_user, "MAKE_RELEASE") %}
{{ render_releases_edit(package.releases, package) }}
{% else %}
{{ render_releases_download(package.releases, package) }}
{{ render_releases_download(package.releases, package, current_user) }}
{% endif %}
</div>
{% endblock %}

@ -431,7 +431,7 @@
{% if package.checkPerm(current_user, "MAKE_RELEASE") %}
{{ render_releases(releases, package, current_user) }}
{% else %}
{{ render_releases_download(releases, package) }}
{{ render_releases_download(releases, package, current_user) }}
{% endif %}
<a class="list-group-item list-group-item-action text-center py-1 text-muted" href="{{ package.getURL("packages.list_releases") }}">
More