-
Notifications
You must be signed in to change notification settings - Fork 117
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
Error importing User from django auth models #278
Comments
… ID when importing django User directly
@eronmedeiros I think that's because that error message was missing the decorator. Can you try installing pylint-django from this branch and see if it fixes things? https://github.com/PyCQA/pylint-django/tree/bugfix/278-add-auth-user-error-code @atodorov I think my branch here will fix things: https://github.com/PyCQA/pylint-django/tree/bugfix/278-add-auth-user-error-code |
… ID when importing django User directly
@carlio I've merged this into master. Closing this issue. |
Hey guys, I encountered the same error and disabled it using the error number provided by the bug fix described above. So thanks for providing that error number. 👍 I'm wondering, though: why is that error message appearing in the first place? The line of code from django.contrib.auth.models import User comes straight from the Django documentation: https://docs.djangoproject.com/en/3.1/topics/auth/default/ Why should it give an error? |
FTR Django doesn't always document or even follow its practices. |
Hello guys,
Bonne journée |
@gdowdy3 I believe it might be because they recognize that people may replace the User model with their own custom model. Tucked away in the docs is this https://docs.djangoproject.com/en/3.1/topics/auth/customizing/#referencing-the-user-model Not saying that the other documentation doesn't need updating, but this would be my suspicion. |
Hey there,
I'm getting an error and I don't know why it is showing up.
It is a new django project. I'm running everything normally.
Except, on every code that imports:
from django.contrib.auth.models import User
It says:
User model imported from django.contrib.auth.models pylint(imported-auth-user)
It shows no error code, so I can't even remove it like I did with function doc string errors, in the .pylintrc file.
The text was updated successfully, but these errors were encountered: