Skip to content

Commit ca176fb

Browse files
committed
More fixing, mypy should pass now.
1 parent f770c08 commit ca176fb

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

ninja_extra/controllers/base.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -316,7 +316,7 @@ def tags(self, value: Union[str, List[str], None]) -> None:
316316
tag = [value]
317317
self._tags = tag
318318

319-
def __call__(self, cls: Type) -> Union[Type, Type["ControllerBase"]]:
319+
def __call__(self, cls: Type) -> Type[ControllerBase]:
320320
from ninja_extra.throttling import throttle
321321

322322
self.auto_import = getattr(cls, "auto_import", self.auto_import)
@@ -469,7 +469,7 @@ def add_api_operation(
469469
@overload
470470
def api_controller(
471471
prefix_or_class: Type,
472-
) -> Union[Type[ControllerBase]]: # pragma: no cover
472+
) -> Type[ControllerBase]: # pragma: no cover
473473
...
474474

475475

@@ -480,7 +480,7 @@ def api_controller(
480480
tags: Union[Optional[List[str]], str] = None,
481481
permissions: Optional["PermissionType"] = None,
482482
auto_import: bool = True,
483-
) -> Union[Callable[..., ControllerBase]]: # pragma: no cover
483+
) -> Callable[[Type], Type[ControllerBase]]: # pragma: no cover
484484
...
485485

486486

@@ -490,7 +490,7 @@ def api_controller(
490490
tags: Union[Optional[List[str]], str] = None,
491491
permissions: Optional["PermissionType"] = None,
492492
auto_import: bool = True,
493-
) -> Union[Type[ControllerBase], Callable[..., ControllerBase]]:
493+
) -> Union[Type[ControllerBase], Callable[[Type], Type[ControllerBase]]]:
494494
if isinstance(prefix_or_class, type):
495495
return APIController(
496496
prefix="",
@@ -500,7 +500,7 @@ def api_controller(
500500
auto_import=auto_import,
501501
)(prefix_or_class)
502502

503-
def _decorator(cls: Type) -> Union[Type[ControllerBase], Any]:
503+
def _decorator(cls: Type) -> Type[ControllerBase]:
504504
return APIController(
505505
prefix=str(prefix_or_class),
506506
auth=auth,

0 commit comments

Comments
 (0)