Skip to content

Let users request account deletion via a reviewer-approved queue (#164) - #175

Merged
xusheng6 merged 2 commits into
mainfrom
feature/account-deletion-requests
Jul 26, 2026
Merged

Let users request account deletion via a reviewer-approved queue (#164)#175
xusheng6 merged 2 commits into
mainfrom
feature/account-deletion-requests

Conversation

@xusheng6

Copy link
Copy Markdown
Contributor

Closes #164.

What

Adds a self-service account deletion flow, gated behind reviewer approval.

User side

  • On their own profile, a logged-in user now sees a Delete Account link (next to Change Password).
  • /delete-account shows a warning + password confirmation. Submitting creates a pending request (it does not delete anything immediately). Duplicate pending requests are collapsed into one.

Reviewer side

  • The reviewer dashboard gains an Account deletion requests link and a pending count.
  • /review/accountdeletionrequests lists pending requests. Approving is admin-only and runs the existing delete_user_account cascade, then emails the user a confirmation. Rejecting (any reviewer) notifies the requester in-app with an optional reason.
  • The requester's email is denormalized onto the request document so the confirmation email can still be sent after the user document is deleted.

FAQ

Rewrote "How do I delete my account?" to document:

  • the self-service flow (Profile → Delete Account),
  • the 30-day processing window (usually much faster),
  • if you can't log in but still have your email: reset the password via Forgot Password, then log in and request deletion,
  • if you also lost access to the registered email: email crackmesone@gmail.com.

Notes

  • Approval reuses the existing admin delete_user_account logic — no change to deletion semantics.
  • New model account_deletion_request follows the existing label_request request-queue pattern.

Tests

Added tests/test_account_deletion.py (9 tests) covering request creation, password/duplicate/login guards, listing, admin approval + email + status transition, non-admin rejection, and reject-with-notification. Full suite: 236 passed.

🤖 Generated with Claude Code

xusheng6 and others added 2 commits July 25, 2026 22:54
Adds a self-service account deletion flow:

- Logged-in users can request deletion from their profile
  ("Delete Account"), confirming with their password. Requests land in
  a pending queue instead of deleting immediately.
- Reviewers see the queue on the dashboard; an admin approves a request,
  which runs the existing full account deletion and emails the (now
  former) user a confirmation. Any reviewer can reject, which notifies
  the requester in-app.
- The requester's email is denormalized onto the request so the
  confirmation email can be sent after the user document is gone.
- FAQ "How do I delete my account?" now documents the self-service flow,
  the 30-day processing window (usually much faster), the reset-then-
  login path when the password is forgotten, and the email fallback when
  the registered address is also lost.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Style the two account-management links on the profile page as spectre
buttons (Delete Account uses btn-error) instead of plain text links.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@xusheng6
xusheng6 merged commit a240876 into main Jul 26, 2026
4 checks passed
@xusheng6
xusheng6 deleted the feature/account-deletion-requests branch July 26, 2026 03:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Allow the user to request account deletion

1 participant