Hi Luke,

On Sat, Sep 3, 2011 at 9:13 PM, Luke Plant <l.plant...@cantab.net> wrote:
> On 25/08/11 00:39, Russell Keith-Magee wrote:
>
>> On principle, I have no objection to the idea of making the admin
>> templates more robust in the presence of TEMPLATE_STRING_IF_INVALID;
>> adding dummy values in the context sounds like a reasonable approach
>> -- *if* doing this doesn't undermine broader error handling in the
>> templates.
>
> If we call this a bug, and agree to fix it, does it mean that from now
> on for any changes to the admin template we have to be careful to test
> with TEMPLATE_STRING_IF_INVALID != '' ?

We could switch admin test suite to always run with proposed
TEMPLATE_STRING_IF_INVALID = RaiseMissingVariable() and check if there
are more mistakes, fix mistakes (if any), and make final patch!
Any missing {{ variable }} could be easily replaced with {% firstof
variable "" %} -- it works, and I remember |default and
|default_if_none didn't few years ago. Not sure if it's still the
same.

At least there are
https://code.djangoproject.com/browser/django/trunk/tests/regressiontests/admin_views/tests.py
and
https://code.djangoproject.com/browser/django/trunk/tests/regressiontests/admin_inlines/tests.py
which render admin templates.

> That sounds kind of tedious, and I would be against making a promise
> never to break this again in the future. If we can fix it now with
> relatively little incovenience, fine, but I don't want that to turn into
> a promise.
Then we could generously ask to show us a test which breaks admin
output when TEMPLATE_STRING_IF_INVALID = RaiseMissingVariable()

I don't believe there will be much work, because current patch
proposes to fix exactly same wart that were there 4 years ago, just
with different, more elegant, piece of code -- check my
https://code.djangoproject.com/ticket/3579 ( some part has been fixed
later at https://code.djangoproject.com/ticket/4497 ).

-- 
Best regards, Yuri V. Baburov, Skype: yuri.baburov, MSN: bu...@live.com

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers" group.
To post to this group, send email to django-developers@googlegroups.com.
To unsubscribe from this group, send email to 
django-developers+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-developers?hl=en.

Reply via email to