pyramid_cubicweb/core.py
changeset 11568 a9940c6cd693
parent 11566 59548227ecc9
child 11575 97110b4af42f
equal deleted inserted replaced
11567:4f8aa5fcd5da 11568:a9940c6cd693
   246         if (request.exception is not None and not isinstance(
   246         if (request.exception is not None and not isinstance(
   247             request.exception, (
   247             request.exception, (
   248                 httpexceptions.HTTPSuccessful,
   248                 httpexceptions.HTTPSuccessful,
   249                 httpexceptions.HTTPRedirection))):
   249                 httpexceptions.HTTPRedirection))):
   250             cnx.rollback()
   250             cnx.rollback()
       
   251         elif cnx._cnx.commit_state == 'uncommitable':
       
   252             cnx.rollback()
   251         else:
   253         else:
   252             cnx.commit()
   254             cnx.commit()
   253         cnx.__exit__(None, None, None)
   255         cnx.__exit__(None, None, None)
   254 
   256 
   255     request.add_finished_callback(cleanup)
   257     request.add_finished_callback(cleanup)