Skip to content

Commit

Permalink
Allow None on view_on_site (#2419)
Browse files Browse the repository at this point in the history
This makes it consistent with `get_view_on_site_url` signature where it is used.
  • Loading branch information
nijel authored Oct 25, 2024
1 parent 82cb4c0 commit 8de9d9a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion django-stubs/contrib/admin/options.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ class BaseModelAdmin(Generic[_ModelT]):
def has_view_or_change_permission(self, request: HttpRequest, obj: _ModelT | None = ...) -> bool: ...
def has_module_permission(self, request: HttpRequest) -> bool: ...
@property
def view_on_site(self) -> Callable[[_ModelT], str] | bool: ...
def view_on_site(self) -> Callable[[_ModelT], str | None] | bool: ...

_ModelAdmin = TypeVar("_ModelAdmin", bound=ModelAdmin[Any])
_ActionCallable: TypeAlias = Callable[[_ModelAdmin, HttpRequest, QuerySet[_ModelT]], HttpResponseBase | None]
Expand Down

0 comments on commit 8de9d9a

Please sign in to comment.