diff options
| author | Adam Johnson <me@adamj.eu> | 2024-08-27 19:14:50 +0100 |
|---|---|---|
| committer | Natalia <124304+nessita@users.noreply.github.com> | 2024-08-27 15:17:47 -0300 |
| commit | 03e0ab5c64d4bc09c6932268b29efcc789a0f7af (patch) | |
| tree | 0859946c27fef71e1c6f0edbf481f70273759792 /django/utils/html.py | |
| parent | f362c3dea239b9903c35aff66412747c5cb8e933 (diff) | |
[5.1.x] Refs #34609 -- Fixed deprecation warning stack level in format_html().
Co-authored-by: Simon Charette <charette.s@gmail.com>
Backport of 2b71b2c8dcd40f2604310bb3914077320035b399 from main.
Diffstat (limited to 'django/utils/html.py')
| -rw-r--r-- | django/utils/html.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/django/utils/html.py b/django/utils/html.py index 154c820d34..e5ad5646fa 100644 --- a/django/utils/html.py +++ b/django/utils/html.py @@ -129,10 +129,11 @@ def format_html(format_string, *args, **kwargs): """ if not (args or kwargs): # RemovedInDjango60Warning: when the deprecation ends, replace with: - # raise ValueError("args or kwargs must be provided.") + # raise TypeError("args or kwargs must be provided.") warnings.warn( "Calling format_html() without passing args or kwargs is deprecated.", RemovedInDjango60Warning, + stacklevel=2, ) args_safe = map(conditional_escape, args) kwargs_safe = {k: conditional_escape(v) for (k, v) in kwargs.items()} |
