From 7669a62096df7e90787dc5f2844fb2dce5e3a259 Mon Sep 17 00:00:00 2001 From: Marti Raudsepp Date: Tue, 15 Nov 2022 13:16:07 +0200 Subject: [PATCH] Fix "Missing return statement" --- mypy_django_plugin/main.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/mypy_django_plugin/main.py b/mypy_django_plugin/main.py index 86bbd80ecf..4ec9539972 100644 --- a/mypy_django_plugin/main.py +++ b/mypy_django_plugin/main.py @@ -249,6 +249,8 @@ def get_customize_class_mro_hook(self, fullname: str) -> Optional[Callable[[Clas and sym.node.has_base(fullnames.BASE_MANAGER_CLASS_FULLNAME) ): return reparametrize_any_manager_hook + else: + return None def get_base_class_hook(self, fullname: str) -> Optional[Callable[[ClassDefContext], None]]: # Base class is a Model class definition @@ -309,6 +311,8 @@ def get_type_analyze_hook(self, fullname: str) -> Optional[Callable[[AnalyzeType "django_stubs_ext.annotations.WithAnnotations", ): return partial(handle_annotated_type, django_context=self.django_context) + else: + return None def get_dynamic_class_hook(self, fullname: str) -> Optional[Callable[[DynamicClassDefContext], None]]: # Create a new manager class definition when a manager's '.from_queryset' classmethod is called