mirror of
https://gitlab.archlinux.org/archlinux/aurweb.git
synced 2025-02-03 10:43:03 +01:00
fix(templates): require valid User relationships for <a> usage
Previously, when the relationship was None, an <a> would still wrap the None value erroneously. This addresses that for all three user fields. In addition, this commit adds direct testing for the `templates/partials/packages/details.html` template. Signed-off-by: Kevin Morris <kevr@0cost.org>
This commit is contained in:
parent
278490e103
commit
53fabdfaea
2 changed files with 230 additions and 8 deletions
|
@ -96,9 +96,9 @@
|
|||
<tr>
|
||||
<th>{{ "Submitter" | tr }}:</th>
|
||||
<td>
|
||||
{% if request.user.is_authenticated() %}
|
||||
{% if request.user.is_authenticated() and pkgbase.Submitter %}
|
||||
<a href="/account/{{ pkgbase.Submitter.Username }}">
|
||||
{{ pkgbase.Submitter.Username | default("None" | tr) }}
|
||||
{{ pkgbase.Submitter.Username }}
|
||||
</a>
|
||||
{% else %}
|
||||
{{ pkgbase.Submitter.Username | default("None" | tr) }}
|
||||
|
@ -108,9 +108,9 @@
|
|||
<tr>
|
||||
<th>{{ "Maintainer" | tr }}:</th>
|
||||
<td>
|
||||
{% if request.user.is_authenticated() %}
|
||||
{% if request.user.is_authenticated() and pkgbase.Maintainer %}
|
||||
<a href="/account/{{ pkgbase.Maintainer.Username }}">
|
||||
{{ pkgbase.Maintainer.Username | default("None" | tr) }}
|
||||
{{ pkgbase.Maintainer.Username }}
|
||||
</a>
|
||||
{% else %}
|
||||
{{ pkgbase.Maintainer.Username | default("None" | tr) }}
|
||||
|
@ -120,9 +120,9 @@
|
|||
<tr>
|
||||
<th>{{ "Last Packager" | tr }}:</th>
|
||||
<td>
|
||||
{% if request.user.is_authenticated() %}
|
||||
{% if request.user.is_authenticated() and pkgbase.Packager %}
|
||||
<a href="/account/{{ pkgbase.Packager.Username }}">
|
||||
{{ pkgbase.Packager.Username | default("None" | tr) }}
|
||||
{{ pkgbase.Packager.Username }}
|
||||
</a>
|
||||
{% else %}
|
||||
{{ pkgbase.Packager.Username | default("None" | tr) }}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue