Skip to content

Commit

Permalink
[dashboard] fix missing datasource issue
Browse files Browse the repository at this point in the history
Addresses a bug that happens when rendering a dashboard for which
a datasource behind one of the slices has been deleted
  • Loading branch information
mistercrunch committed May 5, 2017
1 parent 33758bf commit 9a3889a
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion superset/views/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -1629,7 +1629,12 @@ def dashboard(self, dashboard_id):
qry = qry.filter_by(slug=dashboard_id)

dash = qry.one()
datasources = {slc.datasource for slc in dash.slices}
datasources = set()
for slc in dash.slices:
datasource = slc.datasource
if datasource:
datasources.add(datasource)

for datasource in datasources:
if datasource and not self.datasource_access(datasource):
flash(
Expand Down

0 comments on commit 9a3889a

Please sign in to comment.