From b35cc36e192cb7c96f194cc0851178a8616e8e53 Mon Sep 17 00:00:00 2001 From: "Timothy J. Baek" Date: Tue, 2 Apr 2024 09:42:45 -0700 Subject: [PATCH] chore: formatting --- backend/constants.py | 1 - backend/utils/utils.py | 2 ++ 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/backend/constants.py b/backend/constants.py index ffd639f91..da1ee0b3f 100644 --- a/backend/constants.py +++ b/backend/constants.py @@ -65,4 +65,3 @@ class ERROR_MESSAGES(str, Enum): CREATE_API_KEY_ERROR = "Oops! Something went wrong while creating your API key. Please try again later. If the issue persists, contact support for assistance." EMPTY_CONTENT = "The content provided is empty. Please ensure that there is text or data present before proceeding." - diff --git a/backend/utils/utils.py b/backend/utils/utils.py index 071bb0ef9..d5bb04e90 100644 --- a/backend/utils/utils.py +++ b/backend/utils/utils.py @@ -95,6 +95,7 @@ def get_current_user( detail=ERROR_MESSAGES.UNAUTHORIZED, ) + def get_current_user_by_api_key(api_key: str): from apps.web.models.auths import Auths @@ -106,6 +107,7 @@ def get_current_user_by_api_key(api_key: str): ) return user + def get_verified_user(user=Depends(get_current_user)): if user.role not in {"user", "admin"}: raise HTTPException(