From c517b1032fda86f0cf925fba06b5f82897df92f9 Mon Sep 17 00:00:00 2001 From: Duy Nguyen Date: Wed, 10 Feb 2021 16:26:10 +0700 Subject: [PATCH] Update http error code from 400 to 403 --- superset/views/core.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/superset/views/core.py b/superset/views/core.py index cf0ca7d4dddd5..e2ba393b24c27 100755 --- a/superset/views/core.py +++ b/superset/views/core.py @@ -764,13 +764,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: @@ -929,7 +929,7 @@ def save_or_overwrite_slice( _("You don't have the rights to ") + _("alter this ") + _("dashboard"), - status=400, + status=403, ) flash( @@ -947,7 +947,7 @@ def save_or_overwrite_slice( _("You don't have the rights to ") + _("create a ") + _("dashboard"), - status=400, + status=403, ) dash = Dashboard(