You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.
davidism
changed the title
flask 2.0.0 issue with flask-login and test_client()
custom converter with flask-login doesn't have access to session
May 14, 2021
This is because of #3776, which asked to make the matched request available when loading the session object. However, that means the session object isn't available when matching the request. It's impossible to have both. I think it makes more sense to have the session available to custom converters, so I'll roll back #3794.
After rolling back #3794, if you're writing a custom session loader and need the endpoint, then you can call:
_request_ctx_stack.top.match_request()
If you need both, you'll need to write your converters so they will still match without the session, then call match_request() manually in your session code like above. That way the matching will run twice, first without the session, then with it to do the real match.
Hi there,
With the flask 2.0.0 upgrade I get the following backtrace in a test suite:
The pseudo code in the falling test, looks like:
The session access that failed is done in the
installation
converter and it looks like:Environment:
If you need more info, just ask :)
The text was updated successfully, but these errors were encountered: