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_r292995956
 
 

 ##########
 File path: superset/views/core.py
 ##########
 @@ -1271,7 +1271,10 @@ 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 Exception as e:
+                flash(_('Can not import dashboard: {}').format(e), 'danger')
 
 Review comment:
   While "can not" is not wrong, "cannot" is much more usual.

----------------------------------------------------------------
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]

Reply via email to