mirror of
				https://gitlab.ub.uni-bielefeld.de/sfb1288inf/nopaque.git
				synced 2025-11-03 20:02:47 +00:00 
			
		
		
		
	Code enhancement
This commit is contained in:
		@@ -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'))
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user