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.Dismiss alert
the issue was not with the use of g but with the fact that flask_sijax.py basically uses a global var to store the per request instanciated sijax object, resulting in unwanted behaviour.
Anyway, I think I've fixed the issue by doing a find and replace of self._sijax to request.sijax.
Replace all g.sijax with request.sijax. (also in your htmls) and it should be fine.
If someone is still interested in using this lib, I've attached the modified version of flask_sijax.py. flask_sijax.py.tar.gz
Is this a regression with some new version of Flask?
It's been working fine for me and I've never encountered any issue. Nor have I heard of anyone else report it.
I'm not doing any Python web development anymore, but.. If you'd like to submit a PR with this or any other fixes, I'd be happy to merge them and release a new version of Flask-Sijax, etc.
It may well be due to a change in Flask. This issue only occurs when during processing of one sijax request another sijax request with a different path is made.t I'm using this lib at the moment so I'll do some more testing to make sure my changes work correctly before doing a PR.
in flask_sijax.py:
def _on_before_request(self):
g.sijax = self
...
g's scope is the app context, not the request context
The text was updated successfully, but these errors were encountered: