On 05 Mar 2016, at 17:16, Tim Graham <[email protected]> wrote:
> The behavior of escape running last no matter its position doesn't seem so 
> intuitive
That’s putting it mildly, considering that Django explicitly makes the parallel 
between template filters and Unix pipes.

> but it could be problematic to simply change it. A way forward could be to 
> deprecate the escape filter in favor of a new filter called 
> conditional_escape which would simply call the function of the same name. 
> With the new filter, template authors will get equivalent behavior to escape 
> as long as they put this filter last. 

This is a bit annoying because we won’t end up with the best name: 
|conditional_escape instead of just |escape.

> Alternatively, we could raise a deprecation warning if the escape filter 
> isn't last in the list of filters and then change the behavior to use 
> conditional_escape() at the end of the deprecation period.
This would be my inclination.

> This has the potential to be less safe for users, however, as a project might 
> skip over the Django versions with the warnings and not realize the behavior 
> has changed. On the other hand, I hope few users are running with autoscape 
> off and writing code like the test.
> 

Considering that:

- we recommend upgrading version by version,
- hitting this edge case requires some seriously contrived code,
- with the new LTS scheme we designed recently, the warning will remain longer, 
(until the next LTS inclusive, I think?), reducing the risk to miss it,

I don’t think we should let this concern stop us. 

-- 
Aymeric.

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers  (Contributions to Django itself)" 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].
Visit this group at https://groups.google.com/group/django-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/FDF1E966-1288-4B0C-83E1-859168747465%40polytechnique.org.
For more options, visit https://groups.google.com/d/optout.

Reply via email to