Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

πŸ› Handle non-existing user IDs in read_user_by_id #1396

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
saltie2193 wants to merge 3 commits into fastapi:master
base: master
Choose a base branch
Loading
from saltie2193:backend-read-user-by-id-no-user

Conversation

Copy link
Contributor

@saltie2193 saltie2193 commented Oct 12, 2024

Fix an issue where read_user_by_id would fail to return if the requested user ID did not exist.

  • Return 404 - Not Found when ID does not exist.
  • Request without sufficient permission will always result in 403 - Unauthorized.
  • Add tests to test requesting non-existing user IDs as superuser and normal user.

dupanovic and bereydev reacted with thumbs up emoji
Fix an issue where `read_user_by_id` would fail to return if the requested user ID did not exist.
* Return `404 - Not Found` when ID does not exist.
* Request without sufficient permission will always result in `403 - Unauthorized`.
* Add tests to test requesting non-existing user IDs as superuser and normal user.
@alejsdev alejsdev changed the title (ε‰Šι™€) πŸ‘· Handle non-existing user IDs in read_user_by_id. (ε‰Šι™€γ“γ“γΎγ§) (追記) πŸ› Handle non-existing user IDs in read_user_by_id. (θΏ½θ¨˜γ“γ“γΎγ§) Oct 24, 2024
@alejsdev alejsdev added the bug Something isn't working label Oct 24, 2024
@alejsdev alejsdev changed the title (ε‰Šι™€) πŸ› Handle non-existing user IDs in read_user_by_id. (ε‰Šι™€γ“γ“γΎγ§) (追記) πŸ› Handle non-existing user IDs in read_user_by_id (θΏ½θ¨˜γ“γ“γΎγ§) Oct 24, 2024
Copy link

berar commented Nov 7, 2024

Hello. I'd like to know why this pull request has not been approved. It is valid.

bereydev reacted with thumbs up emoji

Copy link

Yeah pretty minor upgrade but it makes sens to merge IMO.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Reviewers
No reviews
Assignees
No one assigned
Labels
bug Something isn't working
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

AltStyle γ«γ‚ˆγ£γ¦ε€‰ζ›γ•γ‚ŒγŸγƒšγƒΌγ‚Έ (->γ‚ͺγƒͺγ‚ΈγƒŠγƒ«) /