Skip to content

Commit

Permalink
Fix the bug of charts/slices cannot be filtered by datasource name. (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
liutgnu authored and mistercrunch committed Feb 5, 2018
1 parent 6d37d97 commit ad21227
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions superset/views/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -1189,7 +1189,8 @@ def explore(self, datasource_type, datasource_id):
slice_overwrite_perm,
slice_download_perm,
datasource_id,
datasource_type)
datasource_type,
datasource.name)

form_data['datasource'] = str(datasource_id) + '__' + datasource_type

Expand Down Expand Up @@ -1255,7 +1256,7 @@ def filter(self, datasource_type, datasource_id, column):

def save_or_overwrite_slice(
self, args, slc, slice_add_perm, slice_overwrite_perm, slice_download_perm,
datasource_id, datasource_type):
datasource_id, datasource_type, datasource_name):
"""Save or overwrite a slice"""
slice_name = args.get('slice_name')
action = args.get('action')
Expand All @@ -1267,7 +1268,7 @@ def save_or_overwrite_slice(
slc = models.Slice(owners=[g.user] if g.user else [])

slc.params = json.dumps(form_data)
slc.datasource_name = args.get('datasource_name')
slc.datasource_name = datasource_name
slc.viz_type = form_data['viz_type']
slc.datasource_type = datasource_type
slc.datasource_id = datasource_id
Expand Down

0 comments on commit ad21227

Please sign in to comment.