From 1aa0b407a7d2e6374542c60beadd1fe7e50b4edd Mon Sep 17 00:00:00 2001 From: Clayton Craft Date: Sun, 14 Mar 2021 23:20:29 -0700 Subject: [PATCH] settings/general: schedule non-blocking delete_user task --- ridecasa/settings/views.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ridecasa/settings/views.py b/ridecasa/settings/views.py index 5314158..8f460a9 100644 --- a/ridecasa/settings/views.py +++ b/ridecasa/settings/views.py @@ -8,6 +8,7 @@ from ridecasa.models import db from ridecasa import bcrypt from ridecasa.settings.forms import (SettingsSecurityForm, SettingsDeleteUserForm, SettingsPrivacyGeofenceForm) +from ridecasa.tasks import delete_user from ridecasa.util import geohash_decode, geohash_encode, remove_parens @@ -124,7 +125,9 @@ def general(): flash('Current password is incorrect.', 'error') return render_template('settings/general.html', form=form, selected_tab='general') - orm.delete(u for u in db.User if u.id == current_user.id) + + # schedule task to delete user later + delete_user(current_user.id) logout_user() return redirect('/login') return render_template('settings/general.html', form=form, -- 2.45.2