Skip to content

Commit

Permalink
fix: Plain error message when visiting a dashboard via permalink with…
Browse files Browse the repository at this point in the history
…out permissions (#27132)
  • Loading branch information
michael-s-molina committed Feb 22, 2024
1 parent 0308095 commit 7ab62e1
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions superset/views/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
from superset.commands.chart.exceptions import ChartNotFoundError
from superset.commands.chart.warm_up_cache import ChartWarmUpCacheCommand
from superset.commands.dashboard.importers.v0 import ImportDashboardsCommand
from superset.commands.dashboard.exceptions import DashboardAccessDeniedError
from superset.commands.dashboard.permalink.get import GetDashboardPermalinkCommand
from superset.commands.dataset.exceptions import DatasetNotFoundError
from superset.commands.explore.form_data.create import CreateFormDataCommand
Expand Down Expand Up @@ -880,6 +881,9 @@ def dashboard_permalink(
except DashboardPermalinkGetFailedError as ex:
flash(__("Error: %(msg)s", msg=ex.message), "danger")
return redirect("/dashboard/list/")
except DashboardAccessDeniedError as ex:
flash(__("Error: %(msg)s", msg=ex.message), "danger")
return redirect("/dashboard/list/")
if not value:
return json_error_response(_("permalink state not found"), status=404)
dashboard_id, state = value["dashboardId"], value.get("state", {})
Expand Down

0 comments on commit 7ab62e1

Please sign in to comment.