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):
<img width="795" alt="image"
src="https://github.com/StanGirard/quivr/assets/88370405/7db55e74-159c-43e1-b9f7-8384dad9be30">

Co-authored-by: HamzaKhalid-bboxx <127825841+HamzaKhalid-bboxx@users.noreply.github.com>
Co-authored-by: Zineb El Bachiri <100568984+gozineb@users.noreply.github.com>
This commit is contained in:
HamzaKhalid 2023-10-11 19:06:37 +05:00 committed by GitHub
parent b9172b7442
commit 024dd5a264
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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
)