diff options
| author | Salvo Polizzi <plzslv03@studium.unict.it> | 2024-02-10 17:50:55 +0100 |
|---|---|---|
| committer | Mariusz Felisiak <felisiak.mariusz@gmail.com> | 2024-02-14 13:17:40 +0100 |
| commit | e6fa74f02068b2c112de41e9c785f31041668a64 (patch) | |
| tree | 324547013a37a3a7778c6fce313bc39a7745c8b3 /django/utils | |
| parent | bf692b2fdcb5e55fafa5d3d38e286407eeef2ef4 (diff) | |
Fixed #35179 -- Made admindocs detect positional/keyword-only arguments.
Diffstat (limited to 'django/utils')
| -rw-r--r-- | django/utils/inspect.py | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/django/utils/inspect.py b/django/utils/inspect.py index 81a15ed2db..4e065f0347 100644 --- a/django/utils/inspect.py +++ b/django/utils/inspect.py @@ -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 |
