Skip to content

Commit ca10ee9

Browse files
authored
Fix staff_member_required annotations (#436)
* Fix staff_member_required annotations `redirect_field_name` can be `None`. * Reformat code with black
1 parent f651f27 commit ca10ee9

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed
Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
1-
from typing import Callable, TypeVar, overload
1+
from typing import Callable, Optional, TypeVar, overload
22

33
_C = TypeVar("_C", bound=Callable)
44
@overload
5-
def staff_member_required(view_func: _C = ..., redirect_field_name: str = ..., login_url: str = ...) -> _C: ...
5+
def staff_member_required(
6+
view_func: _C = ..., redirect_field_name: Optional[str] = ..., login_url: str = ...
7+
) -> _C: ...
68
@overload
7-
def staff_member_required(view_func: None = ..., redirect_field_name: str = ..., login_url: str = ...) -> Callable: ...
9+
def staff_member_required(
10+
view_func: None = ..., redirect_field_name: Optional[str] = ..., login_url: str = ...
11+
) -> Callable: ...

0 commit comments

Comments
 (0)