Add settings modal with account management#97
Open
vanajmoorthy wants to merge 1 commit into
Open
Conversation
Placeholder for the settings modal reimplementation. See PR description for full implementation plan. Co-Authored-By: Claude Opus 4.6 <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.
Summary
Reimplement the settings modal from #72 (closed due to merge conflicts after 65 commits diverged on main). This PR consolidates all user account management into a single modal dialog accessible from the dashboard.
Plan
1. Backend: New forms (
core/forms.py)UpdateEmailForm— validates email format and case-insensitive uniquenessChangePasswordForm— validates current password + new password confirmation2. Backend: New views (
core/views.py)update_email_view—@login_required @require_POST, handles email update with duplicate checking, returns JSON for AJAXchange_password_view—@login_required @require_POST, changes password and re-authenticates user (prevents logout), returns JSONdelete_account_view—@login_required @require_POST, requires text confirmation ("DELETE") + password verification, deletes user cascade, returns JSONupdate_privacy_viewandupdate_recommendation_visibilityto support both AJAX (JSON response) and form POST (redirect) patterns3. Backend: URLs (
core/urls.py)Add 3 new paths:
4. Backend: Analytics (
core/analytics/events.py)track_account_deleted(user_id)eventtrack_settings_updated()to cover email/password changes5. Frontend: Settings modal template (
core/templates/core/partials/settings_modal.html)New partial with Alpine.js state management containing:
update_username_api)6. Frontend: Dashboard integration (
core/templates/core/dashboard.html)settingsOpento the existingshareModalData()Alpine.js scope (or merge scopes)7. Database migration
UserProfile.is_publicdefault fromFalsetoTrue(new migration)8. Tests (
core/tests/test_settings.py)Comprehensive test suite covering:
Files to modify
core/forms.py— add 2 formscore/views.py— add 3 views, enhance 2 existing viewscore/urls.py— add 3 URL pathscore/analytics/events.py— add 1 event, update 1 eventcore/models.py— changeis_publicdefault (1 line)core/templates/core/dashboard.html— add settings button + modal include, remove inline privacy togglecore/templates/core/partials/settings_modal.html— new filecore/tests/test_settings.py— new filecore/migrations/0027_*.py— new migrationTest plan
🤖 Generated with Claude Code