diff --git a/django-stubs/views/csrf.pyi b/django-stubs/views/csrf.pyi index 7b76e7df5..047eb07e3 100644 --- a/django-stubs/views/csrf.pyi +++ b/django-stubs/views/csrf.pyi @@ -1,7 +1,9 @@ +from pathlib import Path + from django.http.request import HttpRequest from django.http.response import HttpResponseForbidden -CSRF_FAILURE_TEMPLATE: str CSRF_FAILURE_TEMPLATE_NAME: str +def builtin_template_path(name: str) -> Path: ... def csrf_failure(request: HttpRequest, reason: str = ..., template_name: str = ...) -> HttpResponseForbidden: ... diff --git a/django-stubs/views/decorators/debug.pyi b/django-stubs/views/decorators/debug.pyi index 0b16ae1dc..240bd0957 100644 --- a/django-stubs/views/decorators/debug.pyi +++ b/django-stubs/views/decorators/debug.pyi @@ -1,7 +1,9 @@ from collections.abc import Callable -from typing import Any, TypeVar +from typing import Any, Literal, TypeVar _F = TypeVar("_F", bound=Callable[..., Any]) +coroutine_functions_to_sensitive_variables: dict[int, Literal["__ALL__"] | tuple[str, ...]] + def sensitive_variables(*variables: str) -> Callable[[_F], _F]: ... def sensitive_post_parameters(*parameters: str) -> Callable[[_F], _F]: ... diff --git a/django-stubs/views/generic/edit.pyi b/django-stubs/views/generic/edit.pyi index d1dbc6bcf..0ec2af651 100644 --- a/django-stubs/views/generic/edit.pyi +++ b/django-stubs/views/generic/edit.pyi @@ -67,10 +67,7 @@ class DeletionMixin(Generic[_M]): class BaseDeleteView(Generic[_M, _ModelFormT], DeletionMixin[_M], FormMixin[_ModelFormT], BaseDetailView[_M]): object: _M - def __init__(self, *args: Any, **kwargs: Any) -> None: ... class DeleteView(Generic[_M, _ModelFormT], SingleObjectTemplateResponseMixin, BaseDeleteView[_M, _ModelFormT]): object: _M template_name_suffix: str - -class DeleteViewCustomDeleteWarning(Warning): ... diff --git a/django-stubs/views/i18n.pyi b/django-stubs/views/i18n.pyi index 3724450cc..48031f8cb 100644 --- a/django-stubs/views/i18n.pyi +++ b/django-stubs/views/i18n.pyi @@ -1,4 +1,5 @@ from collections.abc import Callable +from pathlib import Path from typing import Any from django.http.request import HttpRequest @@ -8,11 +9,10 @@ from django.views.generic import View LANGUAGE_QUERY_PARAMETER: str +def builtin_template_path(name: str) -> Path: ... def set_language(request: HttpRequest) -> HttpResponse: ... def get_formats() -> dict[str, list[str] | int | str]: ... -js_catalog_template: str - class JavaScriptCatalog(View): head: Callable domain: str diff --git a/django-stubs/views/static.pyi b/django-stubs/views/static.pyi index 1ed01facc..acc1124ea 100644 --- a/django-stubs/views/static.pyi +++ b/django-stubs/views/static.pyi @@ -1,13 +1,14 @@ +from pathlib import Path from typing import Any from django.http import FileResponse, HttpResponse from django.http.request import HttpRequest +def builtin_template_path(name: str) -> Path: ... def serve( request: HttpRequest, path: str, document_root: str | None = ..., show_indexes: bool = ... ) -> FileResponse: ... -DEFAULT_DIRECTORY_INDEX_TEMPLATE: str template_translatable: Any def directory_index(path: Any, fullpath: Any) -> HttpResponse: ... diff --git a/scripts/stubtest/allowlist_todo_django50.txt b/scripts/stubtest/allowlist_todo_django50.txt index 25c1b4930..76bc9d2d5 100644 --- a/scripts/stubtest/allowlist_todo_django50.txt +++ b/scripts/stubtest/allowlist_todo_django50.txt @@ -254,12 +254,3 @@ django.utils.text.add_truncation_text django.utils.timezone.make_aware django.utils.timezone.utc django.utils.topological_sort -django.views.csrf.CSRF_FAILURE_TEMPLATE -django.views.csrf.builtin_template_path -django.views.decorators.debug.coroutine_functions_to_sensitive_variables -django.views.generic.edit.BaseDeleteView.__init__ -django.views.generic.edit.DeleteViewCustomDeleteWarning -django.views.i18n.builtin_template_path -django.views.i18n.js_catalog_template -django.views.static.DEFAULT_DIRECTORY_INDEX_TEMPLATE -django.views.static.builtin_template_path