mirror of
https://gitlab.archlinux.org/archlinux/aurweb.git
synced 2025-02-03 10:43:03 +01:00
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
This commit is contained in:
parent
9648628a2c
commit
0e82916b0a
2 changed files with 7 additions and 4 deletions
|
@ -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):
|
||||
|
|
Loading…
Add table
Reference in a new issue