From 69404ac120f00afe2981bd28ee8f0ecf593d646e Mon Sep 17 00:00:00 2001 From: Ismael Carnales Date: Fri, 30 Oct 2009 17:00:30 -0200 Subject: removed RequireLoginMiddleware --- main/middleware.py | 19 ------------------- 1 file changed, 19 deletions(-) (limited to 'main') diff --git a/main/middleware.py b/main/middleware.py index 8f249c6..1e70b24 100644 --- a/main/middleware.py +++ b/main/middleware.py @@ -33,29 +33,10 @@ from django.http import HttpResponseRedirect import re import threading -class RequireLoginMiddleware(object): - """ - Require Login middleware. If enabled, each Django-powered page will - require authentication. - - If an anonymous user requests a page, he/she is redirected to the login - page set by LOGIN_URL. - """ - def __init__(self): - self.exceptionre = re.compile("(^/media/)|(^/robots.txt)|(^/login/)") - - def process_request(self, request): - if request.user.is_anonymous() and not self.exceptionre.search(request.path): - if request.POST: - return login(request) - else: - return HttpResponseRedirect('%s?next=%s' % (settings.LOGIN_URL, request.path)) - user_holder = threading.local() user_holder.user = None -# END REQUIRE LOGIN MIDDLEWARE class AutoUserMiddleware(object): '''Saves the current user so it can be retrieved by the admin''' -- cgit v1.2.3-24-g4f1b