]> git.openstreetmap.org Git - osqa.git/blobdiff - forum/middleware/request_utils.py
Fixes OSQA 393, cannot send feedback when user is authenticated.
[osqa.git] / forum / middleware / request_utils.py
index 46d56b73f9add106b03b896ad8d6e75bec51fa27..40736bf7ff2ce1b88f5239741c0ec62e3943da88 100644 (file)
@@ -1,7 +1,6 @@
 from forum.settings import MAINTAINANCE_MODE, APP_LOGO, APP_TITLE\r
-from django.http import HttpResponseGone\r
-from django.template.loader import render_to_string\r
 \r
+from forum.http_responses import HttpResponseServiceUnavailable\r
 \r
 class RequestUtils(object):\r
     def __init__(self):\r
@@ -31,11 +30,7 @@ class RequestUtils(object):
             ip = request.META['REMOTE_ADDR']\r
 \r
             if not ip in MAINTAINANCE_MODE.value['allow_ips']:\r
-                return HttpResponseGone(render_to_string('410.html', {\r
-                    'message': MAINTAINANCE_MODE.value.get('message', ''),\r
-                    'app_logo': APP_LOGO,\r
-                    'app_title': APP_TITLE\r
-                }))\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