def language(request, code): next = request.POST.get('next', request.GET.get('next')) if not is_safe_url(url=next, host=request.get_host()): next = request.META.get('HTTP_REFERER') if not is_safe_url(url=next, host=request.get_host()): next = '/' response = http.HttpResponseRedirect(next) l = PageLogic(request) l.set_language(code, response=response) return response
def process_request(self, request): page_logic = PageLogic(request) page_logic.store_request() return None # Continue processing request