mirror of
https://github.com/django/django.git
synced 2025-11-07 07:15:35 +00:00
Fixed #35179 -- Made admindocs detect positional/keyword-only arguments.
This commit is contained in:
committed by
Mariusz Felisiak
parent
bf692b2fdc
commit
e6fa74f020
@@ -68,9 +68,7 @@ def func_accepts_var_args(func):
|
||||
|
||||
def method_has_no_args(meth):
|
||||
"""Return True if a method only accepts 'self'."""
|
||||
count = len(
|
||||
[p for p in _get_callable_parameters(meth) if p.kind == p.POSITIONAL_OR_KEYWORD]
|
||||
)
|
||||
count = len([p for p in _get_callable_parameters(meth) if p.kind in ARG_KINDS])
|
||||
return count == 0 if inspect.ismethod(meth) else count == 1
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user