#22294: length filter changes type of output to string if passed safe string
--------------------------------------+------------------------------------
Reporter: steve.pike@… | Owner: nobody
Type: Cleanup/optimization | Status: new
Component: Template system | Version: master
Severity: Normal | Resolution:
Keywords: filter safe | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
--------------------------------------+------------------------------------
Changes (by bmispelon):
* needs_better_patch: => 0
* needs_tests: => 0
* version: 1.5 => master
* needs_docs: => 0
* type: Uncategorized => Cleanup/optimization
* stage: Unreviewed => Accepted
Comment:
Hi,
I agree that this behavior is not obvious and could lead to hard-to-debug
issues.
I don't really see a reason why `length` needs `is_safe=True`, since it
should normally return either integers, or an empty string in case of an
error.
In fact, making this change doesn't seem to break any existing test which
is a good sign.
--
Ticket URL: <https://code.djangoproject.com/ticket/22294#comment:1>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/086.82bf9d4f6b9f2fb4f8d5e98651c155eb%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.