Carriage return.
[archweb_dev-nj.git] / lib / sitelogin.py
blob53721095a7cff5167e7ab30ccb137ff51fd69c8f
1 from django.contrib.auth.views import logout_then_login, login
2 from django.conf import settings
4 class SiteLogin:
5 def __init__(self):
6 self.login_path = settings.LOGIN_URL
7 def process_request(self, request):
8 if request.user.is_anonymous() and request.path != self.login_path:
9 if request.POST:
10 return login(request)
11 else:
12 return HttpResponseRedirect('%s?next=%s' % (self.login_path, request.path))
14 # vim: set ts=4 sw=4 et: