Skip to content
Snippets Groups Projects
Verified Commit 33d31d41 authored by Mario Oenning's avatar Mario Oenning
Browse files

style: Indicate deleted accounts on requests page


Show "(deleted)" on requests page for user accounts that were removed.

Fixes #505

Signed-off-by: default avatarmoson <moson@archlinux.org>
parent ed878c8c
No related branches found
No related tags found
1 merge request!808Indicate deleted accounts on requests page
Pipeline #101386 passed
...@@ -119,12 +119,15 @@ ...@@ -119,12 +119,15 @@
<td> <td>
{# Filed by #} {# Filed by #}
{# If the record has an associated User, display a link to that user. #} {# 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 %} {% if result.User %}
<a href="/account/{{ result.User.Username }}"> <a href="/account/{{ result.User.Username }}">
{{ result.User.Username }} {{ result.User.Username }}
</a>&nbsp; </a>
{% else %}
<i>(deleted)</i>
{% endif %} {% endif %}
&nbsp;
<a target="_blank" rel="noopener noreferrer" href="{{ result.ml_message_url() }}"> <a target="_blank" rel="noopener noreferrer" href="{{ result.ml_message_url() }}">
(PRQ#{{ result.ID }}) (PRQ#{{ result.ID }})
</a> </a>
......
...@@ -834,6 +834,16 @@ def test_requests( ...@@ -834,6 +834,16 @@ def test_requests(
rows = root.xpath('//table[@class="results"]/tbody/tr') rows = root.xpath('//table[@class="results"]/tbody/tr')
assert len(rows) == 5 # There are five records left on the second page. 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( def test_requests_with_filters(
client: TestClient, client: TestClient,
......
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