On Wed, Oct 14, 2009 at 8:24 AM, Luke Plant <[email protected]> wrote:
>
> I want to fix #6552 (also #12031), and I've attached a patch that
> makes the auth context processor lazy.
>
> I'm pretty sure this is the right thing to do, but I'd like to check
> for any gotchas people might be aware of.
>
> Some behavioural changes:
>
>  * user.get_and_delete_messages() will not be run if the page template
> doesn't iterate over 'messages'.  If you had a view which set some
> messages, followed by a template (that used RequestContext) which
> didn't display messages, it would silently delete messages.  Now,
> those messages will be displayed at a later point.  I think this is a
> bug fix, not a problem.
>
>  * the output of {{ user }} in a template will be different.  I think
> this is acceptable, because only things like {{ user.username }} are
> actually useful, apart from when debugging.
>
> Other eyeballs on the patch would be welcome.
>
> Luke
>
> --
> "You'll be glad to know, I'm going to donate all the snot I sneeze
> to hospitals for mucus transfusions." (Calvin and Hobbes)
>
> Luke Plant || http://lukeplant.me.uk/
>
> >
>

I think changing the result of {{ user }} in the template is a bad
idea.  Luckily it can easily be solved by adding an __unicode__ method
that proxies the request to the wrapped object.

Alex

-- 
"I disapprove of what you say, but I will defend to the death your
right to say it." -- Voltaire
"The people's good is the highest law." -- Cicero
"Code can always be simpler than you think, but never as simple as you
want" -- Me

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

Reply via email to