#31920: ASGI/ASYNC SessionMiddleware - SynchronousOnlyOperation exception if
request.user is not unwrapped in sync code
----------------------------------+------------------------------------
Reporter: Michael Galler | Owner: lirontb
Type: New feature | Status: assigned
Component: contrib.sessions | Version: 3.1
Severity: Normal | Resolution:
Keywords: async | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 1
Needs tests: 0 | Patch needs improvement: 1
Easy pickings: 0 | UI/UX: 0
----------------------------------+------------------------------------
Comment (by Jon Janzen):
Should `auser` cache the results of the DB query? AIUI that's how
`SimpleLazyObject` works right now so it should probably be conistent.
For myself, I know there are certain codepaths in my personal installation
that read the equivalent of `request.user` several times during a request.
If it doesn't need to be cached, I see this as a fairly trivial and I'd be
happy to do it. But I'll wait for guidance on my question before moving
forward.
Also, while I'm commenting here: I posted about a larger issue about
asyncifying the auth app overall which touches on this ticket if anyone is
interested in that: https://forum.djangoproject.com/t/asyncifying-django-
contrib-auth-and-signals-and-maybe-sessions/18770
--
Ticket URL: <https://code.djangoproject.com/ticket/31920#comment:16>
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 unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/010701863d9df853-333d44bb-5231-4e5f-9bcf-36c226b9455f-000000%40eu-central-1.amazonses.com.