All changes in save_or_overwrite_slice:
- fix bug
- change text from "slice" to "chart"
- make info localizable 

___

Bug replication steps:
1. remove Admin's "can add on DashboardModelView" permission
2. open a chart in explore page, then click "save" -> "Add to new dashboard"
3. a exception is thrown

```
../incubator-superset/superset/views/core.py", line 1409, in 
save_or_overwrite_slice
    _('You don\'t have the rights to ') + _('create a ') + _('dashboard'),
TypeError: 'NoneType' object is not callable
```

it seems that in function save_or_overwrite_slice,  lazy_gettext's alies _ is 
overridden by a local variable _
```
def save_or_overwrite_slice
        .....
        form_data, _ = self.get_form_data()
        .....

        .....
        _('You don\'t have the rights to ') + _('create a ') + _('dashboard'),
        .....

```




[ Full content available at: 
https://github.com/apache/incubator-superset/pull/5835 ]
This message was relayed via gitbox.apache.org for [email protected]

Reply via email to