#16563: Error pickling request.user
---------------------------------+------------------------------------
Reporter: zero.fuxor@… | Owner: nobody
Type: Bug | Status: new
Component: contrib.auth | Version: 1.3
Severity: Release blocker | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
---------------------------------+------------------------------------
Comment (by poirier):
FYI, the current code that makes request.user a SimpleLazyObject is from
changeset [16305], which was a re-working of [16297], to fix #15929.
A comment cleaned up along the way said:
{{{
# If we access request.user, request.session is accessed, which
results in
# 'Vary: Cookie' being sent in every request that uses this context
# processor, which can easily be every request on a site if
# TEMPLATE_CONTEXT_PROCESSORS has this context processor added. This
kills
# the ability to cache. So, we carefully ensure these attributes are
lazy.
}}}
which seems like a pretty good reason for making request.user lazy.
Would it be possible to fix this instead by fixing the chain of events
somewhere else? e.g. should any access of request.session result in
setting the Vary: Cookie header?
--
Ticket URL: <https://code.djangoproject.com/ticket/16563#comment:14>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" 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-updates?hl=en.