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

Cannot access member "id" for type "AbstractBaseUser" using pyright #242

Open
powelleric opened this issue Jul 18, 2022 · 1 comment
Open
Labels
bug Something isn't working pyright Related to pyright type checker

Comments

@powelleric
Copy link

powelleric commented Jul 18, 2022

I have a custom user model that inherits from AbstractBaseUser, but when I do something like request.user.id, pyright thinks that user is of type AbstractBaseUser (instead of my class MyUser) and it can't find the id property (or any other properties).

My custom User class is specified in my Django settings: AUTH_USER_MODEL = 'userauth.MyUser'.

I notice Mypy is aware of Django settings. Is pyright not equipped to do that or am I doing something else wrong?

@powelleric powelleric added the bug Something isn't working label Jul 18, 2022
@Skorpyon
Copy link

Skorpyon commented Nov 13, 2023

@intgr intgr added the pyright Related to pyright type checker label Dec 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working pyright Related to pyright type checker
Development

No branches or pull requests

3 participants