nopaque/app/profile/background_functions.py

10 lines
259 B
Python
Raw Normal View History

2019-11-14 12:40:05 +00:00
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()