changed variable names to snake case
This commit is contained in:
parent
8c8b2d27fc
commit
0fef211f5d
1 changed files with 3 additions and 3 deletions
|
@ -12,9 +12,9 @@ def admin_required():
|
||||||
def decorator(*args, **kwargs):
|
def decorator(*args, **kwargs):
|
||||||
verify_jwt_in_request()
|
verify_jwt_in_request()
|
||||||
claims = get_jwt()
|
claims = get_jwt()
|
||||||
userId = claims["user_id"]
|
user_id = claims["user_id"]
|
||||||
isAdmin = RoleService.is_user_admin(userId)
|
is_admin = RoleService.is_user_admin(user_id)
|
||||||
if isAdmin:
|
if is_admin:
|
||||||
return fn(*args, **kwargs)
|
return fn(*args, **kwargs)
|
||||||
else:
|
else:
|
||||||
raise Unauthorized("You need to have admin permissions.")
|
raise Unauthorized("You need to have admin permissions.")
|
||||||
|
|
Loading…
Reference in a new issue