Skip to content

Commit

Permalink
Merge pull request apache#5019 from timifasubaa/fix_error_message_for…
Browse files Browse the repository at this point in the history
…_missing_datasource

fix missing datasource error message
  • Loading branch information
timifasubaa authored May 18, 2018
2 parents 5a64b3f + 63115fb commit 5505c11
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions superset/views/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -1229,6 +1229,12 @@ def datasource_info(datasource_id, datasource_type, form_data):
datasource = form_data.get('datasource', '')
if '__' in datasource:
datasource_id, datasource_type = datasource.split('__')
# The case where the datasource has been deleted
datasource_id = None if datasource_id == 'None' else datasource_id

if not datasource_id:
raise Exception(
'The datasource associated with this chart no longer exists')
datasource_id = int(datasource_id)
return datasource_id, datasource_type

Expand Down

0 comments on commit 5505c11

Please sign in to comment.