Check request for missing root when cloning
authorThierry Florac <tflorac@ulthar.net>
Wed, 16 Jan 2019 10:45:44 +0100
changeset 316 0cb1711cdd41
parent 315 cf80c22164f9
child 317 66a46827a3e1
Check request for missing root when cloning
src/pyams_utils/request.py
--- a/src/pyams_utils/request.py	Wed Jan 16 10:39:36 2019 +0100
+++ b/src/pyams_utils/request.py	Wed Jan 16 10:45:44 2019 +0100
@@ -190,7 +190,7 @@
 
 def copy_request(request):
     """Create clone of given request, keeping registry and root as well"""
-    root = request.root
+    root = getattr(request, 'root', None)
     request = request.copy()
     if not hasattr(request, 'registry'):
         registry = get_current_registry()