admin delete copy, anon form assertion

This commit is contained in:
2026-10-26 03:03:18 +01:00
parent 9fd1eadc95
commit 3861d99e1f
2 changed files with 3 additions and 1 deletions

View File

@@ -103,7 +103,7 @@
{% if let Some(err) = error %}
<p class="error">{{ err }}</p>
{% endif %}
<p style="font-size:.85em;opacity:.7">This user and all their data will be permanently deleted. Enter your own password to confirm.</p>
<p style="font-size:.85em;opacity:.7">This user and all their data will be permanently deleted, fediverse servers are notified, and the username is retired for good. Enter your own password to confirm.</p>
<form method="POST" action="/users/{{ profile_user_id }}/delete">
<input type="hidden" name="_csrf" value="{{ ctx.csrf_token }}">
<input type="password" name="password" placeholder="Your password" required autocomplete="current-password">

View File

@@ -285,6 +285,8 @@ async fn delete_forms_render_only_where_they_apply() {
// A non-admin viewing someone else, and anonymous viewers, see no form.
let bob_page = format!("/users/{}", bob.user_id);
let (_, _, body) = send(&router, get(&bob_page, None)).await;
assert!(!body.contains(&user_delete(&bob.user_id)), "anonymous");
let (_, _, body) = send(&router, get(&bob_page, Some(&alice.cookie))).await;
assert!(!body.contains(&user_delete(&bob.user_id)), "non-admin");