mirror of
https://gitlab.com/crafty-controller/crafty-4.git
synced 2024-08-30 18:23:09 +00:00
Appease the linter
This commit is contained in:
parent
b34ecf58c2
commit
4051d98f8f
@ -17,8 +17,14 @@ class ApiUsersUserKeyHandler(BaseApiHandler):
|
||||
key = self.controller.users.get_user_api_key(key_id)
|
||||
# does this user id exist?
|
||||
if key is None:
|
||||
self.redirect("/panel/error?error=Invalid Key ID")
|
||||
return
|
||||
return self.finish_json(
|
||||
400,
|
||||
{
|
||||
"status": "error",
|
||||
"error": "INVALID DATA",
|
||||
"error_data": "INVALID KEY",
|
||||
},
|
||||
)
|
||||
|
||||
if (
|
||||
str(key.user_id) != str(auth_data[4]["user_id"])
|
||||
@ -48,7 +54,7 @@ class ApiUsersUserKeyHandler(BaseApiHandler):
|
||||
200,
|
||||
{"status": "ok", "data": data_key},
|
||||
)
|
||||
else:
|
||||
|
||||
if (
|
||||
str(user_id) != str(auth_data[4]["user_id"])
|
||||
and not auth_data[4]["superuser"]
|
||||
@ -187,8 +193,14 @@ class ApiUsersUserKeyHandler(BaseApiHandler):
|
||||
key = self.controller.users.get_user_api_key(key_id)
|
||||
# does this user id exist?
|
||||
if key is None:
|
||||
self.redirect("/panel/error?error=Invalid Key ID")
|
||||
return
|
||||
return self.finish_json(
|
||||
400,
|
||||
{
|
||||
"status": "error",
|
||||
"error": "INVALID DATA",
|
||||
"error_data": "INVALID KEY",
|
||||
},
|
||||
)
|
||||
|
||||
# does this user id exist?
|
||||
target_key = self.controller.users.get_user_api_key(key_id)
|
||||
|
Loading…
Reference in New Issue
Block a user