On Sun, 2009-02-08 at 23:52 -0600, Gary Wilson Jr. wrote:
> On Thu, Feb 5, 2009 at 9:07 AM, Jacob Kaplan-Moss
> <jacob.kaplanm...@gmail.com> wrote:
> > On Thu, Feb 5, 2009 at 9:01 AM, Vinicius Mendes <vbmen...@gmail.com> wrote:
> >> So I decided to write a new messages app and it works very well, the only
> >> problem is the django.core.context_processors.auth.
> >
> > Yeah, this processor has a bunch of bugs in it. I think Malcolm and I
> > figured out that there's something like five different bugs -- not bad
> > for three lines of code!
> 
> Are these documented anywhere, by chance?
> 
> I know the get_and_delete_messages call is problematic because it
> causes evaluation of the LazyUser object created by the
> AuthenticationMiddleware.  This causes both an access to the session
> (causing #6552 - Vary: Cookie [1]) and an extra query on every request
> to grab the user.

That's two of them.

> 
> What are the other issues?

Querying the auth table on every request is an unnecessary query. I
don't think that's in a ticket anywhere; it's not a functionality bug as
much as an obvious opportunity for optimisation (albeit not completely
trivial).

My memory was there were only three "bugs" in those three lines of code
constructing the returned object, not five.

Regards,
Malcolm



--~--~---------~--~----~------------~-------~--~----~
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