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

Type of current_user in routers/post.py should be models.User #5

Open
ekusiadadus opened this issue Feb 8, 2022 · 1 comment
Open

Comments

@ekusiadadus
Copy link

ekusiadadus commented Feb 8, 2022

First of all, thanks for your great YouTube FastAPI lessons!!!
(https://www.youtube.com/watch?v=0sOvCWFmrtA)

This course enables me writing cool backend code of my blogsite.

I found a type errors in this code.

https://github.com/Sanjeev-Thiyagarajan/fastapi-course/blob/main/app/routers/post.py

routers/post.py
on line 19, 41, 57, 73, and 98.

A variable current_user 's type should be models.User. (but it was declared as integer type)

@Abbhiishek
Copy link

current_user 's datatype seem to don't interfere as we are returning the whole user data by get_current_user .
The reason its don't care about the assigned datatype in the function is not explained in the video.
But it works fine with any datatype.

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

No branches or pull requests

2 participants