From a5488e2aad8cc7b0daa95bc9382697dcc07a51b5 Mon Sep 17 00:00:00 2001 From: Tai Dupree Date: Fri, 24 Jan 2020 10:29:51 -0800 Subject: [PATCH 1/2] [dashboard] fix, enable info endpoint --- superset/constants.py | 1 + superset/views/dashboard/api.py | 1 + 2 files changed, 2 insertions(+) diff --git a/superset/constants.py b/superset/constants.py index 78b47e53f75ed..1fb3b689d4514 100644 --- a/superset/constants.py +++ b/superset/constants.py @@ -46,6 +46,7 @@ class RouteMethod: # pylint: disable=too-few-public-methods EDIT = "edit" LIST = "list" SHOW = "show" + INFO = "info" # RestModelView specific EXPORT = "export" diff --git a/superset/views/dashboard/api.py b/superset/views/dashboard/api.py index 80cac55691a65..bdcc84359cbf1 100644 --- a/superset/views/dashboard/api.py +++ b/superset/views/dashboard/api.py @@ -134,6 +134,7 @@ class DashboardRestApi(DashboardMixin, BaseOwnedModelRestApi): include_route_methods = RouteMethod.REST_MODEL_VIEW_CRUD_SET | { RouteMethod.EXPORT, RouteMethod.RELATED, + RouteMethod.INFO, "bulk_delete", # not using RouteMethod since locally defined } resource_name = "dashboard" From 6a16f40bc7990caa7ce06b15984c7844a162f719 Mon Sep 17 00:00:00 2001 From: Tai Dupree Date: Fri, 24 Jan 2020 10:31:19 -0800 Subject: [PATCH 2/2] add info to REST_MODEL_VIEW_CRUD_SET --- superset/constants.py | 2 +- superset/views/dashboard/api.py | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/superset/constants.py b/superset/constants.py index 1fb3b689d4514..64e2136f851f5 100644 --- a/superset/constants.py +++ b/superset/constants.py @@ -59,4 +59,4 @@ class RouteMethod: # pylint: disable=too-few-public-methods # Commonly used sets CRUD_SET = {ADD, LIST, EDIT, DELETE, ACTION_POST} RELATED_VIEW_SET = {ADD, LIST, EDIT, DELETE} - REST_MODEL_VIEW_CRUD_SET = {DELETE, GET, GET_LIST, POST, PUT} + REST_MODEL_VIEW_CRUD_SET = {DELETE, GET, GET_LIST, POST, PUT, INFO} diff --git a/superset/views/dashboard/api.py b/superset/views/dashboard/api.py index bdcc84359cbf1..80cac55691a65 100644 --- a/superset/views/dashboard/api.py +++ b/superset/views/dashboard/api.py @@ -134,7 +134,6 @@ class DashboardRestApi(DashboardMixin, BaseOwnedModelRestApi): include_route_methods = RouteMethod.REST_MODEL_VIEW_CRUD_SET | { RouteMethod.EXPORT, RouteMethod.RELATED, - RouteMethod.INFO, "bulk_delete", # not using RouteMethod since locally defined } resource_name = "dashboard"