cubicweb/pyramid/bwcompat.py
branch3.24
changeset 11812 4e0829ade86f
parent 11811 f09efeead7f9
child 11913 4516c3956d46
--- a/cubicweb/pyramid/bwcompat.py	Wed Nov 09 11:42:33 2016 +0100
+++ b/cubicweb/pyramid/bwcompat.py	Wed Nov 09 11:44:27 2016 +0100
@@ -115,6 +115,11 @@
                 content = vreg['views'].main_template(req, 'login')
                 request.response.status_code = 403
                 request.response.body = content
+        except cubicweb.web.NotFound as ex:
+            view = vreg['views'].select('404', req)
+            content = vreg['views'].main_template(req, view=view)
+            request.response.status_code = ex.status
+            request.response.body = content
         finally:
             # XXX CubicWebPyramidRequest.headers_out should
             # access directly the pyramid response headers.