mirror of
https://gitlab.archlinux.org/archlinux/aurweb.git
synced 2025-02-03 10:43:03 +01:00
style: Indicate deleted accounts on requests page
Show "(deleted)" on requests page for user accounts that were removed. Fixes #505 Signed-off-by: moson <moson@archlinux.org>
This commit is contained in:
parent
ed878c8c5e
commit
33d31d4117
2 changed files with 15 additions and 2 deletions
|
@ -119,12 +119,15 @@
|
|||
<td>
|
||||
{# Filed by #}
|
||||
{# If the record has an associated User, display a link to that user. #}
|
||||
{# Otherwise, display nothing (an empty column). #}
|
||||
{# Otherwise, display "(deleted)". #}
|
||||
{% if result.User %}
|
||||
<a href="/account/{{ result.User.Username }}">
|
||||
{{ result.User.Username }}
|
||||
</a>
|
||||
</a>
|
||||
{% else %}
|
||||
<i>(deleted)</i>
|
||||
{% endif %}
|
||||
|
||||
<a target="_blank" rel="noopener noreferrer" href="{{ result.ml_message_url() }}">
|
||||
(PRQ#{{ result.ID }})
|
||||
</a>
|
||||
|
|
|
@ -834,6 +834,16 @@ def test_requests(
|
|||
rows = root.xpath('//table[@class="results"]/tbody/tr')
|
||||
assert len(rows) == 5 # There are five records left on the second page.
|
||||
|
||||
# Delete requesters user account and check output
|
||||
with db.begin():
|
||||
db.delete(requests[0].User)
|
||||
|
||||
with client as request:
|
||||
request.cookies = cookies
|
||||
resp = request.get("/requests")
|
||||
|
||||
assert "(deleted)" in resp.text
|
||||
|
||||
|
||||
def test_requests_with_filters(
|
||||
client: TestClient,
|
||||
|
|
Loading…
Add table
Reference in a new issue