1 from forum.settings import MAINTAINANCE_MODE, APP_LOGO, APP_TITLE
\r
3 from forum.http_responses import HttpResponseServiceUnavailable
\r
5 class RequestUtils(object):
\r
6 def process_request(self, request):
\r
7 if MAINTAINANCE_MODE.value is not None and isinstance(MAINTAINANCE_MODE.value.get('allow_ips', None), list):
\r
8 ip = request.META['REMOTE_ADDR']
\r
10 if not ip in MAINTAINANCE_MODE.value['allow_ips']:
\r
11 return HttpResponseServiceUnavailable(MAINTAINANCE_MODE.value.get('message', ''))
\r
13 if request.session.get('redirect_POST_data', None):
\r
14 request.POST = request.session.pop('redirect_POST_data')
\r
15 request.META['REQUEST_METHOD'] = "POST"
\r
17 self.request = request
\r