Skip to content
Snippets Groups Projects
Commit 0e82916b authored by Jelle van der Waa's avatar Jelle van der Waa :construction: Committed by Jelle van der Waa
Browse files

fix(python): don't show maintainer link for non logged in users

Show a plain maintainer text for non logged in users like the submitted,
last packager.

Closes #373
parent 9648628a
No related branches found
No related tags found
1 merge request!501fix(python): don't show maintainer link for non logged in users
Pipeline #24347 passed
......@@ -108,7 +108,7 @@
<tr class="pkgmaint">
<th>{{ "Maintainer" | tr }}:</th>
<td>
{% if pkgbase.Maintainer %}
{% if request.user.is_authenticated() and pkgbase.Maintainer %}
<a href="/account/{{ pkgbase.Maintainer.Username }}">
{{ pkgbase.Maintainer.Username }}
</a>
......@@ -118,6 +118,9 @@
{% endif %}
{% else %}
{{ pkgbase.Maintainer.Username | default("None" | tr) }}
{% if comaintainers %}
({{ comaintainers|join(', ') }})
{% endif %}
{% endif %}
</td>
</tr>
......
......@@ -272,9 +272,9 @@ def test_pkgbase_maintainer(client: TestClient, user: User, maintainer: User,
root = parse_root(resp.text)
maint = root.xpath('//table[@id="pkginfo"]/tr[@class="pkgmaint"]/td')[0]
maint, comaint = maint.xpath('./a')
assert maint.text.strip() == maintainer.Username
assert comaint.text.strip() == user.Username
maint, comaint = maint.text.strip().split()
assert maint == maintainer.Username
assert comaint == f'({user.Username})'
def test_pkgbase_voters(client: TestClient, tu_user: User, package: Package):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment