slight changes to config

This commit is contained in:
2020-08-07 16:47:33 +02:00
parent 437cec38e0
commit 160076afcf
2 changed files with 3 additions and 0 deletions

View File

@@ -137,6 +137,9 @@ class UserResource(Resource):
"""Fetch a user given its identifier"""
user = User.get_by_id(id)
if user is not None:
if str(user.role) == str(Config.Roles.ADMIN):
print("role deletion forbidden")
return api_user.abort(403, message="It is not allowed to delete role admin users!")
db.session.delete(user)
db.session.commit()
return "ok"