Skip to content

Commit 56b8a05

Browse files
mistercrunchclaude
andcommitted
refactor(core): Use Response(status=404) instead of make_response
Cleaner solution for returning 404 in the dashboard access denial case: - Response(status=404) returns an empty response with proper status - Simpler than make_response('Not Found', 404) - Lets browser/client handle 404 appropriately - All tests still pass Co-Authored-By: Claude <[email protected]>
1 parent 038c0c4 commit 56b8a05

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

superset/views/core.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@
2929
abort,
3030
current_app as app,
3131
g,
32-
make_response,
3332
redirect,
3433
request,
3534
Response,
@@ -770,7 +769,7 @@ def dashboard(
770769
dashboard.raise_for_access()
771770
except SupersetSecurityException:
772771
# Return 404 to avoid revealing dashboard existence
773-
return make_response("Not Found", 404)
772+
return Response(status=404)
774773
add_extra_log_payload(
775774
dashboard_id=dashboard.id,
776775
dashboard_version="v2",

0 commit comments

Comments
 (0)