Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[bugfix] clarifying how to create a slice #2565

Merged
merged 2 commits into from
Apr 11, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 5 additions & 14 deletions superset/views/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -363,20 +363,11 @@ def pre_delete(self, obj):
@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,
Expand Down