]> git.openstreetmap.org Git - osqa.git/blobdiff - forum/middleware/request_utils.py
Add README to the source code
[osqa.git] / forum / middleware / request_utils.py
index e3b5bc25116569f6122f11b19ced94d5c7dc8280..e7fd7403a8ed3697e1563000aa1916d655276822 100644 (file)
@@ -1,7 +1,11 @@
+import forum
+
 from forum.settings import MAINTAINANCE_MODE, APP_LOGO, APP_TITLE
 
 from forum.http_responses import HttpResponseServiceUnavailable
 
+
+
 class RequestUtils(object):
     def process_request(self, request):
         if MAINTAINANCE_MODE.value is not None and isinstance(MAINTAINANCE_MODE.value.get('allow_ips', None), list):
@@ -15,4 +19,10 @@ class RequestUtils(object):
             request.META['REQUEST_METHOD'] = "POST"
 
         self.request = request
-        return None
\ No newline at end of file
+        forum.REQUEST_HOLDER.request = request
+        return None
+
+    def process_response(self, request, response):
+        forum.REQUEST_HOLDER.request = None
+        return response
+