diff --git a/awx/main/middleware.py b/awx/main/middleware.py index 8ae8d444e1..90e74af7e1 100644 --- a/awx/main/middleware.py +++ b/awx/main/middleware.py @@ -178,7 +178,7 @@ class URLModificationMiddleware(object): return '/'.join(url_units) def process_request(self, request): - if 'REQUEST_URI' in request.environ: + if hasattr(request, 'environ') and 'REQUEST_URI' in request.environ: old_path = six.moves.urllib.parse.urlsplit(request.environ['REQUEST_URI']).path old_path = old_path[request.path.find(request.path_info):] else: