nopaque/app/profile/background_functions.py

10 lines
240 B
Python
Raw Normal View History

2020-03-27 11:06:11 +00:00
from ..models import User
2019-11-14 12:40:05 +00:00
def delete_user_(app, user_id):
with app.app_context():
2019-11-15 12:09:12 +00:00
user = User.query.get(user_id)
2019-11-14 12:40:05 +00:00
if user is None:
raise Exception('User {} not found!'.format(user_id))
user.delete()