web/views/basecontrollers.py
branchstable
changeset 3571 54743fc6172c
parent 3518 11ce4682187d
child 3589 a5432f99f2d9
child 3599 e64574673827
equal deleted inserted replaced
3570:c31de6ea6984 3571:54743fc6172c
   196             ctrl._edited_entity.complete()
   196             ctrl._edited_entity.complete()
   197         try:
   197         try:
   198             req.cnx.commit() # ValidationError may be raise on commit
   198             req.cnx.commit() # ValidationError may be raise on commit
   199         except ValidationError, ex:
   199         except ValidationError, ex:
   200             return (False, _validation_error(req, ex), ctrl._edited_entity)
   200             return (False, _validation_error(req, ex), ctrl._edited_entity)
       
   201         except Exception, ex:
       
   202             req.cnx.rollback()
       
   203             req.exception('unexpected error while validating form')
       
   204             return (False, req._(str(ex).decode('utf-8')), ctrl._edited_entity)
   201         else:
   205         else:
   202             return (True, ex.location, ctrl._edited_entity)
   206             return (True, ex.location, ctrl._edited_entity)
   203     except Exception, ex:
   207     except Exception, ex:
   204         req.cnx.rollback()
   208         req.cnx.rollback()
   205         req.exception('unexpected error while validating form')
   209         req.exception('unexpected error while validating form')