Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handling users through the DB users table #52

Open
wants to merge 10 commits into
base: main
Choose a base branch
from

Conversation

vporton
Copy link
Contributor

@vporton vporton commented Oct 12, 2023

I changed the DB schema to store users in DB: users table created.

I use now user_ref (int) instead of user_id (VARCHAR) to refer to a user.

In UserInputDto I use pk to refer to the user instead of, as before, his/her email.

I did basic testing and it appears to work, more testing is however needed.

Fixes #6.

@vporton
Copy link
Contributor Author

vporton commented Oct 12, 2023

Currently, it does not work (Python exceptions).

@vporton
Copy link
Contributor Author

vporton commented Oct 12, 2023

To be honest, I am a little confused how to rewrite this. I will concentrate on this PR.

@vporton
Copy link
Contributor Author

vporton commented Oct 13, 2023

It seems that I've finished this PR. It was preliminarily tested and I'd vote to merge it.

@vporton vporton changed the title Changed the DB schema to store users in DB: users table created Handling users through the DB users table Oct 13, 2023
Copy link
Owner

@apssouza22 apssouza22 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. I will test it this weekend.

Thx @vporton

@apssouza22
Copy link
Owner

apssouza22 commented Oct 13, 2023

After logged in and try to use the UI I got an error. user.pk is None

  commands = await agent.handle_user_input(user_input_req)
  File "/Users/alexsandro.souza/projects/my/chatflow/server/src/core/agent/agent_service.py", line 55, in handle_user_input
    add_message_dto = AddMessageDto(
  File "pydantic/main.py", line 341, in pydantic.main.BaseModel.__init__
pydantic.error_wrappers.ValidationError: 1 validation error for AddMessageDto
user_ref
  none is not an allowed value (type=type_error.none.not_allowed)

Screenshot 2023-10-13 at 22 38 14

@apssouza22 apssouza22 self-requested a review October 13, 2023 21:40
@vporton
Copy link
Contributor Author

vporton commented Oct 14, 2023

After logged in and try to use the UI I got an error. user.pk is None

Fixed.

@apssouza22
Copy link
Owner

@vporton I will test it and merge if it is working fine

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Store User Data ina DB
2 participants