From a803705ddca1c869ccd50977d033faa5c8a0464b Mon Sep 17 00:00:00 2001 From: Maxime Beauchemin Date: Mon, 10 Apr 2017 21:46:19 -0700 Subject: [PATCH] [bugfix] clarifying how to create a slice (#2565) * [bugfix] clarifying how to create a slice First time users [rightfully] think that the proper way to create a slice is to click the `+` button on the `Slices` CRUD page. Changing / simplifying the redirect logic and message flashing that was failing here somehow. * Changing message from danger to info --- superset/views/core.py | 19 +++++-------------- 1 file changed, 5 insertions(+), 14 deletions(-) diff --git a/superset/views/core.py b/superset/views/core.py index e67d14fe0f..1d4e4f88a0 100755 --- a/superset/views/core.py +++ b/superset/views/core.py @@ -363,20 +363,11 @@ class SliceModelView(SupersetModelView, DeleteMixin): # noqa @expose('/add', methods=['GET', 'POST']) @has_access def add(self): - widget = self._add() - if not widget: - return redirect(self.get_redirect()) - - sources = ConnectorRegistry.sources - for source in sources: - ds = db.session.query(ConnectorRegistry.sources[source]).first() - if ds is not None: - url = "/{}/list/".format(ds.baselink) - msg = _("Click on a {} link to create a Slice".format(source)) - break - - redirect_url = "/r/msg/?url={}&msg={}".format(url, msg) - return redirect(redirect_url) + flash(__( + "To create a new slice, you can open a data source " + "through the `Sources` menu, or alter an existing slice " + "from the `Slices` menu"), "info") + return redirect('/superset/welcome') appbuilder.add_view( SliceModelView,