Code enhancement

This commit is contained in:
Patrick Jentsch
2019-11-15 12:51:53 +01:00
parent f22bff4ed0
commit aacfe40bd6
6 changed files with 16 additions and 19 deletions

View File

@ -1,10 +1,10 @@
from app import db, logger
from flask import abort, current_app, flash, redirect, render_template, url_for
from flask_login import current_user, login_required, logout_user
from threading import Thread
from . import profile
from .background_functions import delete_user_
from .forms import ChangePasswordForm, EditProfileForm, EditUserSettingsForm
import threading
@profile.route('/', methods=['GET', 'POST'])
@ -94,10 +94,9 @@ def delete_self():
"""
View to delete yourslef and all associated data.
"""
delete_thread = threading.Thread(target=delete_user_,
args=(current_app._get_current_object(),
current_user.id))
delete_thread.start()
thread = Thread(target=delete_user_,
args=(current_app._get_current_object(), current_user.id))
thread.start()
logout_user()
flash('Your account has been deleted!')
return redirect(url_for('main.index'))