cubicweb/web/views/ajaxcontroller.py
changeset 12318 e947954e0ffc
parent 12263 e9dd37ffa076
child 12503 b01dd0ef43aa
equal deleted inserted replaced
12317:5166a1a7e4f4 12318:e947954e0ffc
   161                 self.exception(
   161                 self.exception(
   162                     'an exception occurred while calling js_%s(%s): %s',
   162                     'an exception occurred while calling js_%s(%s): %s',
   163                     fname, args, exc)
   163                     fname, args, exc)
   164             raise RemoteCallFailed(exc_message(exc, self._cw.encoding))
   164             raise RemoteCallFailed(exc_message(exc, self._cw.encoding))
   165         if result is None:
   165         if result is None:
   166             return ''
   166             return b''
   167         # get unicode on @htmlize methods, encoded string on @jsonize methods
   167         # get unicode on @htmlize methods, encoded string on @jsonize methods
   168         elif isinstance(result, text_type):
   168         elif isinstance(result, text_type):
   169             return result.encode(self._cw.encoding)
   169             return result.encode(self._cw.encoding)
   170         return result
   170         return result
   171 
   171