"...git@developer.sourcefind.cn:chenpangpang/open-webui.git" did not exist on "1d458db316ac3ed48a79917cdce2142e4fd69a83"
Commit b35cc36e authored by Timothy J. Baek's avatar Timothy J. Baek
Browse files

chore: formatting

parent 6d1ce995
...@@ -65,4 +65,3 @@ class ERROR_MESSAGES(str, Enum): ...@@ -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." 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." EMPTY_CONTENT = "The content provided is empty. Please ensure that there is text or data present before proceeding."
...@@ -95,6 +95,7 @@ def get_current_user( ...@@ -95,6 +95,7 @@ def get_current_user(
detail=ERROR_MESSAGES.UNAUTHORIZED, detail=ERROR_MESSAGES.UNAUTHORIZED,
) )
def get_current_user_by_api_key(api_key: str): def get_current_user_by_api_key(api_key: str):
from apps.web.models.auths import Auths from apps.web.models.auths import Auths
...@@ -106,6 +107,7 @@ def get_current_user_by_api_key(api_key: str): ...@@ -106,6 +107,7 @@ def get_current_user_by_api_key(api_key: str):
) )
return user return user
def get_verified_user(user=Depends(get_current_user)): def get_verified_user(user=Depends(get_current_user)):
if user.role not in {"user", "admin"}: if user.role not in {"user", "admin"}:
raise HTTPException( raise HTTPException(
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment