Skip to content

Commit

Permalink
Suppress no-member for ManyToManyField. Fixes PyCQA#192 PyCQA#237
Browse files Browse the repository at this point in the history
"remove" and "set" methods were missing on RelatedManager
  • Loading branch information
Pierre Chiquet authored and atodorov committed Jul 7, 2019
1 parent 0bbee43 commit 266b234
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
2 changes: 2 additions & 0 deletions pylint_django/augmentations/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,8 @@
'clear',
'related_name',
'related_query_name',
'remove',
'set',
'limit_choices_to',
'symmetrical',
'through',
Expand Down
9 changes: 9 additions & 0 deletions pylint_django/tests/input/func_noerror_manytomanyfield.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,15 @@ def grant_permissions(self):
self.user_permissions.add(perm)
return self.user_permissions

def add_permission(self, permission):
self.user_permissions.add(permission)

def remove_permission(self, permission):
self.user_permissions.remove(permission)

def set_permissions(self, permissions):
self.user_permissions.set(permissions)

def save(self, *args, **kwargs):
''' Saving while granting new permissions '''
self.is_staff = True
Expand Down

0 comments on commit 266b234

Please sign in to comment.