Skip to content

Commit 2bad302

Browse files
eradmanharveyrendell
authored andcommitted
Remove workaround from check_csrf() (getredash#6919)
This code was supposed to be temporary, and raises an exception if REDASH_MULTI_ORG=true is set.
1 parent ad716ce commit 2bad302

File tree

1 file changed

+1
-12
lines changed

1 file changed

+1
-12
lines changed

redash/security.py

+1-12
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import functools
22

3-
from flask import request, session
3+
from flask import session
44
from flask_login import current_user
55
from flask_talisman import talisman
66
from flask_wtf.csrf import CSRFProtect, generate_csrf
@@ -35,17 +35,6 @@ def inject_csrf_token(response):
3535

3636
@app.before_request
3737
def check_csrf():
38-
# BEGIN workaround until https://github.com/lepture/flask-wtf/pull/419 is merged
39-
if request.blueprint in csrf._exempt_blueprints:
40-
return
41-
42-
view = app.view_functions.get(request.endpoint)
43-
dest = f"{view.__module__}.{view.__name__}"
44-
45-
if dest in csrf._exempt_views:
46-
return
47-
# END workaround
48-
4938
if not current_user.is_authenticated or "user_id" in session:
5039
csrf.protect()
5140

0 commit comments

Comments
 (0)