X-Git-Url: https://git.openstreetmap.org./osqa.git/blobdiff_plain/b885b2a795c839540f299a7e5f33ed4b670101ab..4da66439c7e1cd073b2f97466208730cf5db9dff:/forum/middleware/request_utils.py?ds=sidebyside diff --git a/forum/middleware/request_utils.py b/forum/middleware/request_utils.py index bbccbf7..e3b5bc2 100644 --- a/forum/middleware/request_utils.py +++ b/forum/middleware/request_utils.py @@ -1,18 +1,18 @@ -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 +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