From 0759bbd72dfcf9f5da6e24cd08424a30ef799708 Mon Sep 17 00:00:00 2001 From: moran abadie Date: Fri, 20 Oct 2023 17:43:03 +0200 Subject: [PATCH] fix as manager IndexError: tuple index out of range (#1785) --- mypy_django_plugin/transformers/managers.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mypy_django_plugin/transformers/managers.py b/mypy_django_plugin/transformers/managers.py index 4d362c1d33..0689a46a54 100644 --- a/mypy_django_plugin/transformers/managers.py +++ b/mypy_django_plugin/transformers/managers.py @@ -124,7 +124,7 @@ def _process_dynamic_method( ret_type = Instance(queryset_info, [manager_instance.args[0], manager_instance.args[0]]) variables = [] args_types = method_type.arg_types[1:] - if _has_compatible_type_vars(base_that_has_method): + if _has_compatible_type_vars(base_that_has_method) and manager_instance.args: ret_type = _replace_type_var( ret_type, base_that_has_method.defn.type_vars[0].fullname, manager_instance.args[0] )