Commits

Ian George committed 139d972 Draft

Added the django classonlymethod decorator to checkers.typecheck to suppress E1120 warning for class-based views

Comments (0)

Files changed (1)

pylint/checkers/typecheck.py

         elif isinstance(called, astng.UnboundMethod):
             if called.decorators is not None:
                 for d in called.decorators.nodes:
-                    if isinstance(d, astng.Name) and (d.name == 'classmethod'):
+                    if isinstance(d, astng.Name) and (
+                            d.name in ['classmethod', 'classonlymethod']):
                         # Class methods have an extra implicit 'cls' argument.
                         num_positional_args += 1
                         break