-
Notifications
You must be signed in to change notification settings - Fork 964
Fix #2672: Pass db_session to user delete method #3509
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Fix #2672: Pass db_session to user delete method #3509
Conversation
2c82017 to
a08dd38
Compare
ba588f4 to
1e7fa95
Compare
8df7eb0 to
0cf49f2
Compare
|
Reverted all the imports and else block that were removed , please review the PR @MoralCode |
|
Code looks good! Just make sure to rebase your changes. Id also be curious how this was tested/get a couple maintainers to give it the thumbs up. Overall looks like this is very close to being able to ship! |
0cf49f2 to
51d3688
Compare
|
I tested this by checking the code (the User.delete() method needs a session parameter that wasn't being passed) and writing a mock test to verify the fix works correctly. Also the docker build failure is not related to this PR. It is CI issue with the geckodriver download because gitHub API returned null. Rerunning the build should fix it. |
- Pass required db_session parameter to current_user.delete() - Add try-except block for proper exception handling - Store username before deletion for accurate flash message - Add error logging for debugging failed deletions Signed-off-by: Pratyksh Gupta <pratykshgupta9999@gmail.com> Signed-off-by: guptapratykshh <pratykshgupta9999@gmail.com>
0a52048 to
4793eaf
Compare
Description
This PR fixes a critical bug where users attempting to delete their accounts would encounter a 500 Internal Server Error. The root cause was that the user_delete() route handler was calling
current_user.delete()without passing the required session parameter.db_sessionparameter toUser.delete()methodThis PR fixes #2672
Notes for Reviewers
Signed commits