-
Notifications
You must be signed in to change notification settings - Fork 996
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?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -198,10 +198,11 @@ | |
| @app.route('/account/delete') | ||
| @login_required | ||
| def user_delete(): | ||
| if current_user.delete()[0]: | ||
| if current_user.delete(db_session)[0]: | ||
| flash(f"Account {current_user.login_name} successfully removed") | ||
| logout_user() | ||
| else: | ||
| logger.error(f"Exception occurred while deleting account {current_user.login_name}: {e}") | ||
|
Check warning on line 205 in augur/api/view/routes.py
|
||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There's no
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
| flash("An error occurred removing the account") | ||
|
|
||
| return redirect(url_for("root")) | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not from this PR, but
user_deleteis on a GET route. Might be worth a follow-up to change this to POST.