-
Notifications
You must be signed in to change notification settings - Fork 116
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
RelatedManager passing as a ManyToManyField #163
Comments
Will inspect in the next few days when I have the time. Next time please paste a plain text of your code/error and not a picture. |
This code isn't entirely mine neither I have the authority to share it for the public. |
I've created a repository to show you what I meant. The error resides in Here is the models.py:
|
this doesn't sound right. From what I can see So from what I can tell pylint-django is doing the correct thing by recognizing that user_permissions is a ManyToManyField. |
Disable model-no-explicit-unicode for the test class because Django 1.11 defines the AbstractBaseUser with @python_2_unicode_compatible and we don't care about this issue for this particular test.
First time using a linter (and issue) here. I've noticed that when using
user_permissions
from AbstractUser (that is supposed to be a ManyToMany, as stated by the linter) it is indeed a RelatedManager by some gimmick that I'm unawre of, so when I useuser_permissions.clear()
the linter states a error, when it is valid code.python=3.6.5
pylint=1.91
pylint-django=0.11.1
The class in which the method is defined just inherents
user_permissions
from AbstractUser.So what should have been done? I really don't want to whitelist this error, neither just ignore.
The text was updated successfully, but these errors were encountered: