From 024dd5a264ca245ade81eac00be9820c19fd9fcf Mon Sep 17 00:00:00 2001 From: HamzaKhalid <88370405+HamzaKhalidDhillon@users.noreply.github.com> Date: Wed, 11 Oct 2023 19:06:37 +0500 Subject: [PATCH] fix(user identity): User identity dict has no attribute user_id and open_api_key (#1351) # Description Trying to access access 'user identity' attributes as attribute of dictionary which throws an error since the attributes are actually the key in the dictionary not an attribute of the dictionary object. ## Checklist before requesting a review Please delete options that are not relevant. - [x] My code follows the style guidelines of this project - [x] I have performed a self-review of my code ## Screenshots (if appropriate): image Co-authored-by: HamzaKhalid-bboxx <127825841+HamzaKhalid-bboxx@users.noreply.github.com> Co-authored-by: Zineb El Bachiri <100568984+gozineb@users.noreply.github.com> --- backend/repository/user_identity/create_user_identity.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backend/repository/user_identity/create_user_identity.py b/backend/repository/user_identity/create_user_identity.py index 4315869a2..ccaa84bfe 100644 --- a/backend/repository/user_identity/create_user_identity.py +++ b/backend/repository/user_identity/create_user_identity.py @@ -19,5 +19,5 @@ def create_user_identity(id: UUID, openai_api_key: Optional[str]) -> UserIdentit ) user_identity = response.data[0] return UserIdentity( - id=user_identity.user_id, openai_api_key=user_identity.openai_api_key # type: ignore + id=user_identity.get('user_id'), openai_api_key=user_identity.get('openai_api_key') # type: ignore )