From 1235bc14dbc7f071c335b3cda904cb20330f2af5 Mon Sep 17 00:00:00 2001 From: rubenwardy Date: Mon, 3 Apr 2023 20:43:26 +0100 Subject: [PATCH] Fix account deactivation --- app/blueprints/users/settings.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/blueprints/users/settings.py b/app/blueprints/users/settings.py index ef57882f..765e756e 100644 --- a/app/blueprints/users/settings.py +++ b/app/blueprints/users/settings.py @@ -247,7 +247,8 @@ def delete(username): db.session.delete(user) elif "deactivate" in request.form: - user.replies.delete() + for reply in user.replies.all(): + db.session.delete(reply) for thread in user.threads.all(): db.session.delete(thread) user.email = None