diff --git a/superset/dashboards/api.py b/superset/dashboards/api.py index d97b5f78e3c04..75df1858cf0d4 100644 --- a/superset/dashboards/api.py +++ b/superset/dashboards/api.py @@ -265,6 +265,8 @@ def __repr__(self) -> str: self.appbuilder.app.config["VERSION_SHA"], ) + @expose("/", methods=["GET"]) + @protect() @etag_cache( get_last_modified=lambda _self, id_or_slug: DashboardDAO.get_dashboard_changed_on( # pylint: disable=line-too-long,useless-suppression id_or_slug @@ -275,8 +277,6 @@ def __repr__(self) -> str: ), skip=lambda _self, id_or_slug: not is_feature_enabled("DASHBOARD_CACHE"), ) - @expose("/", methods=["GET"]) - @protect() @safe @statsd_metrics @event_logger.log_this_with_context( @@ -321,6 +321,8 @@ def get(self, dash: Dashboard) -> Response: result = self.dashboard_get_response_schema.dump(dash) return self.response(200, result=result) + @expose("//datasets", methods=["GET"]) + @protect() @etag_cache( get_last_modified=lambda _self, id_or_slug: DashboardDAO.get_dashboard_and_datasets_changed_on( # pylint: disable=line-too-long,useless-suppression id_or_slug @@ -331,8 +333,6 @@ def get(self, dash: Dashboard) -> Response: ), skip=lambda _self, id_or_slug: not is_feature_enabled("DASHBOARD_CACHE"), ) - @expose("//datasets", methods=["GET"]) - @protect() @safe @statsd_metrics @event_logger.log_this_with_context( @@ -386,6 +386,8 @@ def get_datasets(self, id_or_slug: str) -> Response: except DashboardNotFoundError: return self.response_404() + @expose("//charts", methods=["GET"]) + @protect() @etag_cache( get_last_modified=lambda _self, id_or_slug: DashboardDAO.get_dashboard_and_slices_changed_on( # pylint: disable=line-too-long,useless-suppression id_or_slug @@ -396,8 +398,6 @@ def get_datasets(self, id_or_slug: str) -> Response: ), skip=lambda _self, id_or_slug: not is_feature_enabled("DASHBOARD_CACHE"), ) - @expose("//charts", methods=["GET"]) - @protect() @safe @statsd_metrics @event_logger.log_this_with_context(