I think that to convince me to change the current behavior, you would have to present a compelling use case for relying on nonexistent variables as filter arguments. Wouldn't this behavior typically just hide bugs?
On a related note, I proposed removing the logging of undefined template variables here: https://groups.google.com/d/topic/django-developers/zdULZcmAWNw/discussion On Saturday, June 3, 2017 at 10:30:51 AM UTC-4, Shai Berger wrote: > > On Friday 02 June 2017 18:38:47 Vlastimil Zíma wrote: > > > > Shai: Values are sometimes turned into an empty string in case of > > UnicodeDecodeError, see > > > https://github.com/django/django/blob/master/django/template/base.py#L994-L > > 998 > > > > That code is within a render() method -- a place where the value is > already > going to be turned into a string. > > > IMO invalid variable should behave the same way regardless of whether > it's > > printed or used as an filter argument. > > > > My point was that rendering makes a difference because it already implies > a > possible type change. > > I stand by my earlier position: Changing a filter argument to a string is > odd > and unexpected and we shouldn't do this. We should either keep raising an > exception, or replace the whole filter expression (rather than just the > argument) with string_if_invalid. My preference is towards the exception, > but > I also see the value of failing silently here. > > Shai. > -- 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 django-developers+unsubscr...@googlegroups.com. To post to this group, send email to django-developers@googlegroups.com. 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/748566d9-42eb-456d-be86-4d075927a380%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.