src/pyams_utils/request.py
changeset 315 cf80c22164f9
parent 312 7219e0e95439
child 316 0cb1711cdd41
--- a/src/pyams_utils/request.py	Fri Jan 11 13:16:08 2019 +0100
+++ b/src/pyams_utils/request.py	Wed Jan 16 10:39:36 2019 +0100
@@ -189,13 +189,15 @@
 
 
 def copy_request(request):
-    """Create clone of given request, keeping registry as well"""
+    """Create clone of given request, keeping registry and root as well"""
+    root = request.root
     request = request.copy()
     if not hasattr(request, 'registry'):
         registry = get_current_registry()
         if registry is None:
             registry = get_global_registry()
         request.registry = registry
+    request.root = root
     return request