hitdemo opened a new pull request #5835: [bugfix] throw "TypeError: 
'NoneType'..." when save chart to dash
URL: https://github.com/apache/incubator-superset/pull/5835
 
 
   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'),
           .....
   
   ```
   
   
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on 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