From 9c8ab7b0d525526b868a013342c41980b12e7cca Mon Sep 17 00:00:00 2001 From: Tomas Gavenciak Date: Wed, 7 Oct 2015 21:09:57 +0200 Subject: [PATCH] Fix middleware bug --- mamweb/middleware.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mamweb/middleware.py b/mamweb/middleware.py index 616eaa1c..be4efce9 100644 --- a/mamweb/middleware.py +++ b/mamweb/middleware.py @@ -1,7 +1,7 @@ from datetime import datetime, date from django.conf import settings -from django.http import HttpResponse, HttpResponseRedirect, HttpRequest +from django.http import HttpResponse, HttpResponseRedirect @@ -32,7 +32,7 @@ class LoggedInHintCookieMiddleware(object): if not request.is_secure(): if self.cookie_correct(request): # redirect insecure (assuming http) requests with hint cookie to https - url = HttpRequest.build_absolute_uri() + url = request.build_absolute_uri() assert url[:5] == 'http:' return HttpResponseRedirect('https:' + url[5:]) return None