fixed 500 error when export dashboard (#2760)

https://github.com/airbnb/superset/blob/master/superset/views/core.py#L474

http://flask-appbuilder.readthedocs.io/en/latest/actions.html?highlight=action

```
@action("mulexport", __("Export"), __("Export dashboards?"), "fa-database")
    def mulexport(self, items):
        ids = ''.join('&id={}'.format(d.id) for d in items)
```
change to 
```
@action("mulexport", __("Export"), __("Export dashboards?"), "fa-database")
    def mulexport(self, items):
        if not isinstance(items, list):
            items = [items]
        ids = ''.join('&id={}'.format(d.id) for d in items)
```

fixed:
#2184
#2667
This commit is contained in:
eeve 2017-05-16 12:33:07 +08:00 committed by Maxime Beauchemin
parent 9b34600c8e
commit e7946451d6

View File

@ -472,6 +472,8 @@ class DashboardModelView(SupersetModelView, DeleteMixin): # noqa
@action("mulexport", __("Export"), __("Export dashboards?"), "fa-database")
def mulexport(self, items):
if not isinstance(items, list):
items = [items]
ids = ''.join('&id={}'.format(d.id) for d in items)
return redirect(
'/dashboardmodelview/export_dashboards_form?{}'.format(ids[1:]))