mirror of
https://gitlab.ub.uni-bielefeld.de/sfb1288inf/nopaque.git
synced 2025-06-15 02:20:40 +00:00
Update background functions
This commit is contained in:
9
app/profile/background_functions.py
Normal file
9
app/profile/background_functions.py
Normal file
@ -0,0 +1,9 @@
|
||||
from app.models import User
|
||||
|
||||
|
||||
def delete_user_(app, user_id):
|
||||
with app.app_context():
|
||||
user = User.query.filter_by(id=user_id).first()
|
||||
if user is None:
|
||||
raise Exception('User {} not found!'.format(user_id))
|
||||
user.delete()
|
@ -1,8 +1,8 @@
|
||||
from app import db, logger
|
||||
from app.background_functions import delete_user_
|
||||
from flask import abort, current_app, flash, redirect, render_template, url_for
|
||||
from flask_login import current_user, login_required, logout_user
|
||||
from . import profile
|
||||
from .background_functions import delete_user_
|
||||
from .forms import ChangePasswordForm, EditProfileForm, EditUserSettingsForm
|
||||
import threading
|
||||
|
||||
|
Reference in New Issue
Block a user