mirror of
https://github.com/davidhalter/django-stubs.git
synced 2026-10-06 12:18:56 +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 parent
f651f27ddf
commit
ca10ee9242
1 file changed
+7
-3
@@ -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