Skip to content

Commit

Permalink
Update http error code from 400 to 403 (#13061)
Browse files Browse the repository at this point in the history
  • Loading branch information
duynguyenhoang authored Feb 13, 2021
1 parent dae1258 commit 56fca17
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions superset/views/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -766,13 +766,13 @@ def explore( # pylint: disable=too-many-locals,too-many-return-statements
if action == "overwrite" and not slice_overwrite_perm:
return json_error_response(
_("You don't have the rights to ") + _("alter this ") + _("chart"),
status=400,
status=403,
)

if action == "saveas" and not slice_add_perm:
return json_error_response(
_("You don't have the rights to ") + _("create a ") + _("chart"),
status=400,
status=403,
)

if action in ("saveas", "overwrite") and datasource:
Expand Down Expand Up @@ -928,7 +928,7 @@ def save_or_overwrite_slice(
_("You don't have the rights to ")
+ _("alter this ")
+ _("dashboard"),
status=400,
status=403,
)

flash(
Expand All @@ -946,7 +946,7 @@ def save_or_overwrite_slice(
_("You don't have the rights to ")
+ _("create a ")
+ _("dashboard"),
status=400,
status=403,
)

dash = Dashboard(
Expand Down

0 comments on commit 56fca17

Please sign in to comment.