]> git.openstreetmap.org Git - osqa.git/blobdiff - forum/middleware/request_utils.py
OSQA-465, be able to embed YouTube videos. Adding a new setting to the View Settings...
[osqa.git] / forum / middleware / request_utils.py
index bbccbf7462017ff8e44699c1fdbb776b18fa7a40..e3b5bc25116569f6122f11b19ced94d5c7dc8280 100644 (file)
@@ -1,18 +1,18 @@
-from forum.settings import MAINTAINANCE_MODE, APP_LOGO, APP_TITLE\r
-\r
-from forum.http_responses import HttpResponseServiceUnavailable\r
-\r
-class RequestUtils(object):\r
-    def process_request(self, request):\r
-        if MAINTAINANCE_MODE.value is not None and isinstance(MAINTAINANCE_MODE.value.get('allow_ips', None), list):\r
-            ip = request.META['REMOTE_ADDR']\r
-\r
-            if not ip in MAINTAINANCE_MODE.value['allow_ips']:\r
-                return HttpResponseServiceUnavailable(MAINTAINANCE_MODE.value.get('message', ''))\r
-\r
-        if request.session.get('redirect_POST_data', None):\r
-            request.POST = request.session.pop('redirect_POST_data')\r
-            request.META['REQUEST_METHOD'] = "POST"\r
-\r
-        self.request = request\r
+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):
+            ip = request.META['REMOTE_ADDR']
+
+            if not ip in MAINTAINANCE_MODE.value['allow_ips']:
+                return HttpResponseServiceUnavailable(MAINTAINANCE_MODE.value.get('message', ''))
+
+        if request.session.get('redirect_POST_data', None):
+            request.POST = request.session.pop('redirect_POST_data')
+            request.META['REQUEST_METHOD'] = "POST"
+
+        self.request = request
         return None
\ No newline at end of file