slight changes to config
This commit is contained in:
@@ -137,6 +137,9 @@ class UserResource(Resource):
|
|||||||
"""Fetch a user given its identifier"""
|
"""Fetch a user given its identifier"""
|
||||||
user = User.get_by_id(id)
|
user = User.get_by_id(id)
|
||||||
if user is not None:
|
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.delete(user)
|
||||||
db.session.commit()
|
db.session.commit()
|
||||||
return "ok"
|
return "ok"
|
||||||
|
|||||||
Binary file not shown.
Reference in New Issue
Block a user