-
Notifications
You must be signed in to change notification settings - Fork 0
Requests and authentication #2
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
base: master
Are you sure you want to change the base?
Conversation
authentication with JWT todos and auth separated in 2 routers --> main is an app with both routers included
endpoint names changed in todos.py
…user functions in auth.py the model for the user and the function itself changed
routers/todos.py
Outdated
| if user is None: | ||
| raise HTTPException(status_code=401, detail='Authentication Failed') | ||
|
|
||
| todo = db.query(Todo).filter(Todo.id == todo_id).first() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| todo = db.query(Todo).filter(Todo.id == todo_id).first() | |
| todo = get_object_or_404(Todo, Todo.id == todo_id, detail='Todo not found') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
у fastapi нет такого модуля. или ты имел в виду использовать написанный нами тогда собственный?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Я предложил тебе написать тебе такой хелпер
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
а, поняла. ок
extra filters applied settings created
No description provided.