Fix staff_member_required annotations (#436)

* Fix staff_member_required annotations

`redirect_field_name` can be `None`.

* Reformat code with black
This commit is contained in:
Mantas Zimnickas
2020-07-31 10:35:35 +03:00
committed by GitHub
parent f651f27ddf
commit ca10ee9242

View File

@@ -1,7 +1,11 @@
from typing import Callable, TypeVar, overload
from typing import Callable, Optional, TypeVar, overload
_C = TypeVar("_C", bound=Callable)
@overload
def staff_member_required(view_func: _C = ..., redirect_field_name: str = ..., login_url: str = ...) -> _C: ...
def staff_member_required(
view_func: _C = ..., redirect_field_name: Optional[str] = ..., login_url: str = ...
) -> _C: ...
@overload
def staff_member_required(view_func: None = ..., redirect_field_name: str = ..., login_url: str = ...) -> Callable: ...
def staff_member_required(
view_func: None = ..., redirect_field_name: Optional[str] = ..., login_url: str = ...
) -> Callable: ...