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):
|
||||
verify_jwt_in_request()
|
||||
claims = get_jwt()
|
||||
userId = claims["user_id"]
|
||||
isAdmin = RoleService.is_user_admin(userId)
|
||||
if isAdmin:
|
||||
user_id = claims["user_id"]
|
||||
is_admin = RoleService.is_user_admin(user_id)
|
||||
if is_admin:
|
||||
return fn(*args, **kwargs)
|
||||
else:
|
||||
raise Unauthorized("You need to have admin permissions.")
|
||||
|
|
Loading…
Reference in a new issue