Skip to content

Commit

Permalink
fix as manager IndexError: tuple index out of range (#1785)
Browse files Browse the repository at this point in the history
  • Loading branch information
moranabadie committed Oct 20, 2023
1 parent 35bd241 commit 0759bbd
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion mypy_django_plugin/transformers/managers.py
Original file line number Diff line number Diff line change
Expand Up @@ -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]
)
Expand Down

0 comments on commit 0759bbd

Please sign in to comment.