web/views/basecontrollers.py
branchstable
changeset 6109 47d9c0e0f7b7
parent 6107 05061eda1fa7
child 6140 65a619eb31c4
child 6204 fd6d8f4d1904
equal deleted inserted replaced
6108:c459ffa5fa6f 6109:47d9c0e0f7b7
   296         try:
   296         try:
   297             result = func(*args)
   297             result = func(*args)
   298         except (RemoteCallFailed, DirectResponse):
   298         except (RemoteCallFailed, DirectResponse):
   299             raise
   299             raise
   300         except Exception, ex:
   300         except Exception, ex:
   301             self.exception('an exception occured while calling js_%s(%s): %s',
   301             self.exception('an exception occurred while calling js_%s(%s): %s',
   302                            fname, args, ex)
   302                            fname, args, ex)
   303             raise RemoteCallFailed(repr(ex))
   303             raise RemoteCallFailed(repr(ex))
   304         if result is None:
   304         if result is None:
   305             return ''
   305             return ''
   306         # get unicode on @htmlize methods, encoded string on @jsonize methods
   306         # get unicode on @htmlize methods, encoded string on @jsonize methods
   411             extraargs = dict((str(key), value)
   411             extraargs = dict((str(key), value)
   412                              for key, value in extraargs.items())
   412                              for key, value in extraargs.items())
   413         # XXX while it sounds good, addition of the try/except below cause pb:
   413         # XXX while it sounds good, addition of the try/except below cause pb:
   414         # when filtering using facets return an empty rset, the edition box
   414         # when filtering using facets return an empty rset, the edition box
   415         # isn't anymore selectable, as expected. The pb is that with the
   415         # isn't anymore selectable, as expected. The pb is that with the
   416         # try/except below, we see a "an error occured" message in the ui, while
   416         # try/except below, we see a "an error occurred" message in the ui, while
   417         # we don't see it without it. Proper fix would probably be to deal with
   417         # we don't see it without it. Proper fix would probably be to deal with
   418         # this by allowing facet handling code to tell to js_component that such
   418         # this by allowing facet handling code to tell to js_component that such
   419         # error is expected and should'nt be reported.
   419         # error is expected and should'nt be reported.
   420         #try:
   420         #try:
   421         comp = self._cw.vreg[registry].select(compid, self._cw, rset=rset,
   421         comp = self._cw.vreg[registry].select(compid, self._cw, rset=rset,
   599 
   599 
   600     def publish(self, rset=None):
   600     def publish(self, rset=None):
   601         txuuid = self._cw.form['txuuid']
   601         txuuid = self._cw.form['txuuid']
   602         errors = self._cw.cnx.undo_transaction(txuuid)
   602         errors = self._cw.cnx.undo_transaction(txuuid)
   603         if errors:
   603         if errors:
   604             self.w(self._cw._('some errors occured:'))
   604             self.w(self._cw._('some errors occurred:'))
   605             self.wview('pyvalist', pyvalue=errors)
   605             self.wview('pyvalist', pyvalue=errors)
   606         else:
   606         else:
   607             self.redirect()
   607             self.redirect()
   608 
   608 
   609     def redirect(self):
   609     def redirect(self):