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

Use custom API route instead of doing var = ...first() if not var: raise HTTPException, etc. #218

Open
8 tasks
jpmckinney opened this issue Nov 28, 2023 · 0 comments
Assignees
Labels
chore topic: api Relating to the design and architecture of the API

Comments

@jpmckinney
Copy link
Member

jpmckinney commented Nov 28, 2023

https://fastapi.tiangolo.com/how-to/custom-request-and-route/#accessing-the-request-body-in-an-exception-handler

Can then call one() instead of first() and handle sqlalchemy.orm.exc.NoResultFound globally.

Can do this in:

  • get_user
  • get_publication_as_user
  • _get_publication_as_guest_via_uuid
  • last_updated
  • get_object_or_404
  • get_credit_product
  • confirm_credit_product
  • login_mfa
@jpmckinney jpmckinney mentioned this issue Nov 28, 2023
1 task
@yolile yolile moved this to 📋 Backlog in Credere optimization backlog May 7, 2024
@jpmckinney jpmckinney self-assigned this Aug 17, 2024
@jpmckinney jpmckinney added the topic: api Relating to the design and architecture of the API label Aug 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
chore topic: api Relating to the design and architecture of the API
Projects
No open projects
Status: 📋 Backlog
Development

No branches or pull requests

1 participant