pyramid_cubicweb/core.py
changeset 11524 54c83bfda277
parent 11513 0170f8a55620
child 11536 6618408c0629
--- a/pyramid_cubicweb/core.py	Thu Nov 06 22:26:16 2014 +0100
+++ b/pyramid_cubicweb/core.py	Sat Nov 08 23:07:20 2014 +0100
@@ -138,7 +138,10 @@
     cnx = repoapi.ClientConnection(request.cw_session)
 
     def cleanup(request):
-        if request.exception is not None:
+        if (request.exception is not None and not isinstance(
+            request.exception, (
+                httpexceptions.HTTPSuccessful,
+                httpexceptions.HTTPRedirection))):
             cnx.rollback()
         else:
             cnx.commit()