From f8cc99ca3b23ceb9840fdf9ecf4cc354f4b9459a Mon Sep 17 00:00:00 2001 From: David Smith <39445562+smithdc1@users.noreply.github.com> Date: Thu, 30 Jun 2022 08:16:07 +0100 Subject: [PATCH] Improved return type of render_to_string(). (#1036) --- django-stubs/template/loader.pyi | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/django-stubs/template/loader.pyi b/django-stubs/template/loader.pyi index 11e9988..6344ff1 100644 --- a/django-stubs/template/loader.pyi +++ b/django-stubs/template/loader.pyi @@ -2,6 +2,7 @@ from typing import Any, Mapping, Optional, Sequence, Union from django.http.request import HttpRequest from django.template.exceptions import TemplateDoesNotExist as TemplateDoesNotExist # noqa: F401 +from django.utils.safestring import SafeString from . import engines as engines # noqa: F401 from .backends.base import _EngineTemplate @@ -13,4 +14,4 @@ def render_to_string( context: Optional[Mapping[str, Any]] = ..., request: Optional[HttpRequest] = ..., using: Optional[str] = ..., -) -> str: ... +) -> SafeString: ...