betodealmeida commented on a change in pull request #7621: fix: Better error
message for dashboard import
URL:
https://github.com/apache/incubator-superset/pull/7621#discussion_r294972617
##########
File path: superset/views/core.py
##########
@@ -1288,7 +1288,19 @@ def import_dashboards(self):
"""Overrides the dashboards using json instances from the file."""
f = request.files.get('file')
if request.method == 'POST' and f:
- dashboard_import_export.import_dashboards(db.session, f.stream)
+ try:
+ dashboard_import_export.import_dashboards(db.session, f.stream)
+ except DatabaseNotFound as e:
+ flash(_(
+ 'Cannot import dashboard: {}.\n'
+ 'Make sure to create the database before '
+ 'importing the dashboard.',
Review comment:
My bad, I gave a bad example when reviewing this initially.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]