-
Notifications
You must be signed in to change notification settings - Fork 4.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove workaround from check_csrf() #6919
Conversation
This code was supposed to be temporary, and raises an exception if REDASH_MULTI_ORG=true is set. --- Traceback (most recent call last): File "/usr/local/lib/python3.8/site-packages/flask/app.py", line 2213, in __call__ return self.wsgi_app(environ, start_response) File "/usr/local/lib/python3.8/site-packages/werkzeug/middleware/proxy_fix.py", line 182, in __call__ return self.app(environ, start_response) File "/usr/local/lib/python3.8/site-packages/flask/app.py", line 2193, in wsgi_app response = self.handle_exception(e) File "/usr/local/lib/python3.8/site-packages/flask_restful/__init__.py", line 298, in error_router return original_handler(e) File "/usr/local/lib/python3.8/site-packages/flask/app.py", line 2190, in wsgi_app response = self.full_dispatch_request() File "/usr/local/lib/python3.8/site-packages/flask/app.py", line 1486, in full_dispatch_request rv = self.handle_user_exception(e) File "/usr/local/lib/python3.8/site-packages/flask_restful/__init__.py", line 298, in error_router return original_handler(e) File "/usr/local/lib/python3.8/site-packages/flask/app.py", line 1482, in full_dispatch_request rv = self.preprocess_request() File "/usr/local/lib/python3.8/site-packages/flask/app.py", line 1974, in preprocess_request rv = self.ensure_sync(before_func)() File "/app/redash/security.py", line 43, in check_csrf dest = f"{view.__module__}.{view.__name__}" AttributeError: 'NoneType' object has no attribute '__module__'
From the comment in that code, it looks like this was waiting upon PR 419 in the external wtforms/flask-wtf repo to be merged, but it never was, and no-one followed up on it. k, lets merge this as there's no obvious better way for now. 😄 |
This code was supposed to be temporary, and raises an exception if REDASH_MULTI_ORG=true is set.
@justinclift this seems to have broken SAML login for our organization when trying to upgrade to the latest version though unfortunately |
@mjgp2 were you able to confirm that SAML works if you revert this change? We should find an easy method of configuring a SAML provider so that we can test for this kind of regression. |
Yes, confirmed. We're having to run a manually patched version - 25.1.0 tag + revert this |
This workaround was missing 'if view is not None ' as found in https://github.com/pallets-eco/flask-wtf/pull/419/files Tested with MULTI_ORG enabled.
I proposed a change that reverts this change and fixes the exception that motivated this to begin with in |
This workaround was missing 'if view is not None ' as found in https://github.com/pallets-eco/flask-wtf/pull/419/files Tested with MULTI_ORG enabled.
What type of PR is this?
Description
This code was supposed to be temporary, and raises an exception if REDASH_MULTI_ORG=true is set.
How is this tested?
REDASH_MULTI_ORG=true
to.env