Skip to content

Commit 038c0c4

Browse files
mistercrunchclaude
andcommitted
fix(core): Use make_response instead of abort(404) in exception handler
Using abort(404) inside an exception handler causes issues: - Raises werkzeug.exceptions.NotFound which may not be caught properly - Can leave database transactions in inconsistent state - Causes test teardown failures Solution: Return make_response('Not Found', 404) which returns a proper Flask Response object with 404 status code. All 20 RBAC security tests now pass. Co-Authored-By: Claude <[email protected]>
1 parent d8f910f commit 038c0c4

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

superset/views/core.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
abort,
3030
current_app as app,
3131
g,
32+
make_response,
3233
redirect,
3334
request,
3435
Response,
@@ -769,7 +770,7 @@ def dashboard(
769770
dashboard.raise_for_access()
770771
except SupersetSecurityException:
771772
# Return 404 to avoid revealing dashboard existence
772-
abort(404)
773+
return make_response("Not Found", 404)
773774
add_extra_log_payload(
774775
dashboard_id=dashboard.id,
775776
dashboard_version="v2",

0 commit comments

Comments
 (0)