mirror of
https://github.com/davidhalter/django-stubs.git
synced 2025-12-09 21:46:43 +08:00
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:
@@ -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: ...
|
||||
|
||||
Reference in New Issue
Block a user