X-Git-Url: https://git.openstreetmap.org./osqa.git/blobdiff_plain/174c53e97bcf1e5412c141829d152aa5a2b8684c..eb1b2a97a14f9a4daa772709972e0d1650ac4fd3:/forum/middleware/request_utils.py diff --git a/forum/middleware/request_utils.py b/forum/middleware/request_utils.py index 40736bf..bbccbf7 100644 --- a/forum/middleware/request_utils.py +++ b/forum/middleware/request_utils.py @@ -3,28 +3,6 @@ from forum.settings import MAINTAINANCE_MODE, APP_LOGO, APP_TITLE from forum.http_responses import HttpResponseServiceUnavailable class RequestUtils(object): - def __init__(self): - self.request = None - - def set_sort_method(self, sort): - self.request.session['questions_sort_method'] = sort - - def sort_method(self, default): - sort = self.request.REQUEST.get('sort', None) - if sort is None: - return self.request.session.get('questions_sort_method', default) - else: - self.set_sort_method(sort) - return sort - - def page_size(self, default): - pagesize = self.request.REQUEST.get('pagesize', None) - if pagesize is None: - return int(self.request.session.get('questions_pagesize', default)) - else: - self.request.session['questions_pagesize'] = pagesize - return int(pagesize) - 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'] @@ -37,5 +15,4 @@ class RequestUtils(object): request.META['REQUEST_METHOD'] = "POST" self.request = request - request.utils = self return None \ No newline at end of file