Skip to content

Update user.py #14

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Conversation

GloriaSekyere
Copy link

  1. In create() the last line is changed from return user to use get_one(user.name) to confirm we are returning the created user not the same one we passed in the argument.
  2. delete() return type is changed from None to User since create() returns a User
  3. Check for 'if not name' condition before executing the delete query to avoid executing delete queries with an empty string
  4. In model_to_dict() function user.dict() has been changed to user.model_dump() as .dict() is deprecated.

1. In create() the last line is changed from return user to use get_one(user.name) to confirm we are returning the created user not the same one we passed in the argument.
2. delete() return type is changed from None to User since create() returns a User
3. Check for 'if not name' condition before executing the delete query to avoid executing delete queries with an empty string
4. In model_to_dict() function user.dict() has been changed to user.model_dump() as .dict() is deprecated.
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.

1 participant