web/views/basecontrollers.py
branchstable
changeset 3608 5a46e68c3d3c
parent 3599 e64574673827
child 3629 559cad62c786
child 3742 20f429eb5f46
equal deleted inserted replaced
3607:a7c5e62c7e00 3608:5a46e68c3d3c
   199         except Exception, ex:
   199         except Exception, ex:
   200             req.cnx.rollback()
   200             req.cnx.rollback()
   201             req.exception('unexpected error while validating form')
   201             req.exception('unexpected error while validating form')
   202             return (False, req._(str(ex).decode('utf-8')), ctrl._edited_entity)
   202             return (False, req._(str(ex).decode('utf-8')), ctrl._edited_entity)
   203         else:
   203         else:
       
   204             # complete entity: it can be used in js callbacks where we might
       
   205             # want every possible information
       
   206             if ctrl._edited_entity:
       
   207                 ctrl._edited_entity.complete()
   204             return (True, ex.location, ctrl._edited_entity)
   208             return (True, ex.location, ctrl._edited_entity)
   205     except Exception, ex:
   209     except Exception, ex:
   206         req.cnx.rollback()
   210         req.cnx.rollback()
   207         req.exception('unexpected error while validating form')
   211         req.exception('unexpected error while validating form')
   208         return (False, req._(str(ex).decode('utf-8')), ctrl._edited_entity)
   212         return (False, req._(str(ex).decode('utf-8')), ctrl._edited_entity)