mirror of
https://github.com/minetest/contentdb.git
synced 2025-01-08 22:17:34 +01:00
Fix crash in releases list due to missing current_user
argument
This commit is contained in:
parent
4e83adc032
commit
5a12b9e6c4
@ -24,7 +24,7 @@
|
|||||||
{% endmacro %}
|
{% endmacro %}
|
||||||
|
|
||||||
|
|
||||||
{% macro render_releases_download(releases, package) %}
|
{% macro render_releases_download(releases, package, current_user) %}
|
||||||
{% for rel in releases %}
|
{% for rel in releases %}
|
||||||
{% if rel.approved or package.checkPerm(current_user, "MAKE_RELEASE") or rel.checkPerm(current_user, "APPROVE_RELEASE") %}
|
{% 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() }}">
|
<a class="list-group-item list-group-item-action" href="{{ rel.getDownloadURL() }}">
|
||||||
@ -54,48 +54,46 @@
|
|||||||
|
|
||||||
{% macro render_releases(releases, package, current_user) -%}
|
{% macro render_releases(releases, package, current_user) -%}
|
||||||
{% for rel in releases %}
|
{% 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">
|
||||||
<div class="list-group-item">
|
<a class="btn btn-sm btn-primary float-right" href="{{ rel.getEditURL() }}">Edit
|
||||||
<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") %}
|
||||||
{% if not rel.task_id and not rel.approved and rel.checkPerm(current_user, "APPROVE_RELEASE") %}
|
/ Approve
|
||||||
/ Approve
|
{% endif %}
|
||||||
|
</a>
|
||||||
|
|
||||||
|
{% if not rel.approved %}<i>{% endif %}
|
||||||
|
|
||||||
|
<a href="{{ rel.getDownloadURL() }}" rel="nofollow" download="{{ rel.getDownloadFileName() }}">
|
||||||
|
{{ rel.title }}
|
||||||
|
</a>
|
||||||
|
|
||||||
|
<span class="text-muted ml-1">
|
||||||
|
{% if rel.min_rel and rel.max_rel %}
|
||||||
|
[MT {{ rel.min_rel.name }}-{{ rel.max_rel.name }}]
|
||||||
|
{% elif rel.min_rel %}
|
||||||
|
[MT {{ rel.min_rel.name }}+]
|
||||||
|
{% elif rel.max_rel %}
|
||||||
|
[MT ≤{{ rel.max_rel.name }}]
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</a>
|
</span>
|
||||||
|
|
||||||
{% if not rel.approved %}<i>{% endif %}
|
<br>
|
||||||
|
|
||||||
<a href="{{ rel.getDownloadURL() }}" rel="nofollow" download="{{ rel.getDownloadFileName() }}">
|
<small style="color:#999;">
|
||||||
{{ rel.title }}
|
{% if rel.commit_hash %}
|
||||||
</a>
|
[{{ rel.commit_hash | truncate(5, end='') }}]
|
||||||
|
|
||||||
<span class="text-muted ml-1">
|
|
||||||
{% if rel.min_rel and rel.max_rel %}
|
|
||||||
[MT {{ rel.min_rel.name }}-{{ rel.max_rel.name }}]
|
|
||||||
{% elif rel.min_rel %}
|
|
||||||
[MT {{ rel.min_rel.name }}+]
|
|
||||||
{% elif rel.max_rel %}
|
|
||||||
[MT ≤{{ rel.max_rel.name }}]
|
|
||||||
{% endif %}
|
|
||||||
</span>
|
|
||||||
|
|
||||||
<br>
|
|
||||||
|
|
||||||
<small style="color:#999;">
|
|
||||||
{% if rel.commit_hash %}
|
|
||||||
[{{ rel.commit_hash | truncate(5, end='') }}]
|
|
||||||
{% endif %}
|
|
||||||
|
|
||||||
created {{ rel.releaseDate | date }}.
|
|
||||||
</small>
|
|
||||||
{% if (package.checkPerm(current_user, "MAKE_RELEASE") or rel.checkPerm(current_user, "APPROVE_RELEASE")) and rel.task_id %}
|
|
||||||
<a href="{{ url_for('tasks.check', id=rel.task_id, r=package.getURL("packages.view")) }}">Importing...</a>
|
|
||||||
{% elif not rel.approved %}
|
|
||||||
Waiting for approval.
|
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
{% if not rel.approved %}</i>{% endif %}
|
created {{ rel.releaseDate | date }}.
|
||||||
</div>
|
</small>
|
||||||
{% endif %}
|
{% if (package.checkPerm(current_user, "MAKE_RELEASE") or rel.checkPerm(current_user, "APPROVE_RELEASE")) and rel.task_id %}
|
||||||
|
<a href="{{ url_for('tasks.check', id=rel.task_id, r=package.getURL("packages.view")) }}">Importing...</a>
|
||||||
|
{% elif not rel.approved %}
|
||||||
|
Waiting for approval.
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
|
{% if not rel.approved %}</i>{% endif %}
|
||||||
|
</div>
|
||||||
{% else %}
|
{% else %}
|
||||||
<div class="list-group-item">No releases available.</div>
|
<div class="list-group-item">No releases available.</div>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
@ -38,7 +38,7 @@
|
|||||||
{% if package.checkPerm(current_user, "MAKE_RELEASE") %}
|
{% if package.checkPerm(current_user, "MAKE_RELEASE") %}
|
||||||
{{ render_releases_edit(package.releases, package) }}
|
{{ render_releases_edit(package.releases, package) }}
|
||||||
{% else %}
|
{% else %}
|
||||||
{{ render_releases_download(package.releases, package) }}
|
{{ render_releases_download(package.releases, package, current_user) }}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</div>
|
</div>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
@ -431,7 +431,7 @@
|
|||||||
{% if package.checkPerm(current_user, "MAKE_RELEASE") %}
|
{% if package.checkPerm(current_user, "MAKE_RELEASE") %}
|
||||||
{{ render_releases(releases, package, current_user) }}
|
{{ render_releases(releases, package, current_user) }}
|
||||||
{% else %}
|
{% else %}
|
||||||
{{ render_releases_download(releases, package) }}
|
{{ render_releases_download(releases, package, current_user) }}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
<a class="list-group-item list-group-item-action text-center py-1 text-muted" href="{{ package.getURL("packages.list_releases") }}">
|
<a class="list-group-item list-group-item-action text-center py-1 text-muted" href="{{ package.getURL("packages.list_releases") }}">
|
||||||
More
|
More
|
||||||
|
Loading…
Reference in New Issue
Block a user