Add comments on parts we want to reconsider later
authorChristophe de Vienne <christophe@unlish.com>
Tue, 15 Jul 2014 18:13:57 +0200
changeset 11488 baa0988a6029
parent 11487 04252e9ff549
child 11489 433fd3af7386
Add comments on parts we want to reconsider later Related to #4291173
pyramid_cubicweb/handler.py
--- a/pyramid_cubicweb/handler.py	Tue Jul 15 17:37:50 2014 +0200
+++ b/pyramid_cubicweb/handler.py	Tue Jul 15 18:13:57 2014 +0200
@@ -74,6 +74,9 @@
                 # XXX The validation_error_handler implementation is light, we
                 # should redo it better in cw_to_pyramid, so it can be properly
                 # handled when raised from a cubicweb view.
+                # BUT the real handling of validation errors should be done
+                # earlier in the controllers, not here. In the end, the
+                # ValidationError should never by handled here.
                 content = self.appli.validation_error_handler(req, ex)
             except cubicweb.web.RemoteCallFailed as ex:
                 # XXX The default pyramid error handler (or one that we provide
@@ -84,8 +87,9 @@
             if content is not None:
                 request.response.body = content
 
+            # XXX CubicWebPyramidRequest.headers_out should
+            # access directly the pyramid response headers.
             request.response.headers.clear()
-
             for k, v in req.headers_out.getAllRawHeaders():
                 for item in v:
                     request.response.headers.add(k, item)