diff --git a/templates/requests.html b/templates/requests.html index a6b2ae46..95e9f5e1 100644 --- a/templates/requests.html +++ b/templates/requests.html @@ -119,12 +119,15 @@ {# 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 %} {{ result.User.Username }} -   + + {% else %} + (deleted) {% endif %} +   (PRQ#{{ result.ID }}) diff --git a/test/test_requests.py b/test/test_requests.py index dd621cc5..1e9cac65 100644 --- a/test/test_requests.py +++ b/test/test_requests.py @@ -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,