mirror of
https://github.com/django/django.git
synced 2025-08-03 10:34:04 +00:00
Fixed #18400 -- Modified length template filter to return 0 for unknown variables.
Thanks Florian for the bug report, luyikei for the initial code patch, and Bouke for the code review feedback.
This commit is contained in:
parent
84cafc2b35
commit
484f3edf1e
4 changed files with 11 additions and 3 deletions
|
@ -1688,6 +1688,11 @@ For example::
|
|||
If ``value`` is ``['a', 'b', 'c', 'd']`` or ``"abcd"``, the output will be
|
||||
``4``.
|
||||
|
||||
.. versionchanged:: 1.8
|
||||
|
||||
The filter returns ``0`` for an undefined variable. Previously, it returned
|
||||
an empty string.
|
||||
|
||||
.. templatefilter:: length_is
|
||||
|
||||
length_is
|
||||
|
|
|
@ -267,6 +267,9 @@ Miscellaneous
|
|||
|
||||
* ``django.contrib.gis`` dropped support for GEOS 3.1 and GDAL 1.6.
|
||||
|
||||
* The :tfilter:`length` template filter now returns ``0`` for an undefined
|
||||
variable, rather than an empty string.
|
||||
|
||||
.. _deprecated-features-1.8:
|
||||
|
||||
Features deprecated in 1.8
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue