~craftyguy/ridecasa

1aa0b407a7d2e6374542c60beadd1fe7e50b4edd — Clayton Craft 2 years ago 9760a42
settings/general: schedule non-blocking delete_user task
1 files changed, 4 insertions(+), 1 deletions(-)

M ridecasa/settings/views.py
M ridecasa/settings/views.py => ridecasa/settings/views.py +4 -1
@@ 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,