Let users request account deletion via a reviewer-approved queue (#164) - #175
Merged
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #164.
What
Adds a self-service account deletion flow, gated behind reviewer approval.
User side
/delete-accountshows a warning + password confirmation. Submitting creates a pending request (it does not delete anything immediately). Duplicate pending requests are collapsed into one.Reviewer side
/review/accountdeletionrequestslists pending requests. Approving is admin-only and runs the existingdelete_user_accountcascade, then emails the user a confirmation. Rejecting (any reviewer) notifies the requester in-app with an optional reason.FAQ
Rewrote "How do I delete my account?" to document:
Notes
delete_user_accountlogic — no change to deletion semantics.account_deletion_requestfollows the existinglabel_requestrequest-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