Skip to content

Commit

Permalink
[Story]: Bug- connector oauth api keys not found - fixed.
Browse files Browse the repository at this point in the history
  • Loading branch information
S-Nagendra committed Feb 12, 2024
1 parent 81262d6 commit 5ac75af
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions core/oauth_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ def update_obj(request, workspace_id, payload: OAuthSchemaUpdateIn):
return {"detail": "The specific oauth key cannot be updated."}


@router.get("/workspaces/{workspace_id}/keys/{type}", response={200: List[OAuthSchema], 404: Json, 400: DetailSchema})
@router.get("/workspaces/{workspace_id}/keys/{type}", response={200: List[OAuthSchema], 400: DetailSchema})
def get_obj(request, workspace_id, type):
try:
workspace = Workspace.objects.get(id=workspace_id)
Expand All @@ -114,10 +114,8 @@ def get_obj(request, workspace_id, type):
if queryset.exists():
return [queryset.first()]
else:
response_data = {"detail": "The specific oauth key does not exist."}
response_json = json.dumps(response_data)

return (404, response_json)
logger.debug("No found")
return []

except Exception:
return {"detail": "The specific oauth key cannot be fetched."}

0 comments on commit 5ac75af

Please sign in to comment.