#31920: ASGI/ASYNC SessionMiddleware - SynchronousOnlyOperation exception if
request.user is not unwrapped in sync code
----------------------------------+--------------------------------------
     Reporter:  Michael Galler    |                    Owner:  Jon Janzen
         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:  1                 |  Patch needs improvement:  1
Easy pickings:  0                 |                    UI/UX:  0
----------------------------------+--------------------------------------
Changes (by Carlton Gibson):

 * cc: Adam Johnson (added)


Comment:

 Just to follow-up, there was a [https://github.com/python/mypy/issues/9837
 mypy proposal to allow `typing.overload` to work with `T | Awaitable[T]`
 type examples], but that was closed as `wontfix`.

 > No, this isn't something mypy is going to do. Separate methods … is an
 easy solution.

 So, I take it that the `auser()` approach is going with the wind.

 Current PR is looking OK. I just want to investigate if/how sharing the
 cache between `.user` and `.auser()` might work — but any other reviews or
 input welcomed.

-- 
Ticket URL: <https://code.djangoproject.com/ticket/31920#comment:19>
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/01070186a1de6495-f8f7e9a6-034c-4ab0-a689-2d6a49a7e4fb-000000%40eu-central-1.amazonses.com.

Reply via email to