summaryrefslogtreecommitdiff
path: root/django/template
diff options
context:
space:
mode:
authorMariusz Felisiak <felisiak.mariusz@gmail.com>2023-09-12 21:34:40 +0200
committerMariusz Felisiak <felisiak.mariusz@gmail.com>2023-09-18 22:12:40 +0200
commit14ef92fa9e87a77cd3642235387e6f683048046b (patch)
tree5570548f8b6e32fb3ececb32a75a3aac8a0973b0 /django/template
parent2abf417c815c20f41c0868d6f66520b32347106e (diff)
Refs #33864 -- Removed length_is template filter per deprecation timeline.
Diffstat (limited to 'django/template')
-rw-r--r--django/template/defaultfilters.py16
1 files changed, 0 insertions, 16 deletions
diff --git a/django/template/defaultfilters.py b/django/template/defaultfilters.py
index 589ca38414..1e1bdbc5c9 100644
--- a/django/template/defaultfilters.py
+++ b/django/template/defaultfilters.py
@@ -2,7 +2,6 @@
import random as random_module
import re
import types
-import warnings
from decimal import ROUND_HALF_UP, Context, Decimal, InvalidOperation, getcontext
from functools import wraps
from inspect import unwrap
@@ -12,7 +11,6 @@ from urllib.parse import quote
from django.utils import formats
from django.utils.dateformat import format, time_format
-from django.utils.deprecation import RemovedInDjango51Warning
from django.utils.encoding import iri_to_uri
from django.utils.html import avoid_wrapping, conditional_escape, escape, escapejs
from django.utils.html import json_script as _json_script
@@ -622,20 +620,6 @@ def length(value):
return 0
-@register.filter(is_safe=False)
-def length_is(value, arg):
- """Return a boolean of whether the value's length is the argument."""
- warnings.warn(
- "The length_is template filter is deprecated in favor of the length template "
- "filter and the == operator within an {% if %} tag.",
- RemovedInDjango51Warning,
- )
- try:
- return len(value) == int(arg)
- except (ValueError, TypeError):
- return ""
-
-
@register.filter(is_safe=True)
def random(value):
"""Return a random item from the list."""