Ticket #3185: login_url2.diff
File login_url2.diff, 1.8 KB (added by , 18 years ago) |
---|
-
django/contrib/auth/views.py
6 6 from django.contrib.sites.models import Site 7 7 from django.http import HttpResponseRedirect 8 8 from django.contrib.auth.decorators import login_required 9 from django.contrib.auth import LOGIN_URL, REDIRECT_FIELD_NAME 9 from django.contrib.auth import LOGIN_URL, REDIRECT_FIELD_NAME, ACCOUNT_URL 10 10 11 11 def login(request, template_name='registration/login.html'): 12 12 "Displays the login form and handles the login action." … … 17 17 if not errors: 18 18 # Light security check -- make sure redirect_to isn't garbage. 19 19 if not redirect_to or '://' in redirect_to or ' ' in redirect_to: 20 redirect_to = '/accounts/profile/'20 redirect_to = ACCOUNT_URL 21 21 from django.contrib.auth import login 22 22 login(request, manipulator.get_user()) 23 23 request.session.delete_test_cookie() -
django/contrib/auth/__init__.py
1 1 from django.core.exceptions import ImproperlyConfigured 2 2 3 from django.conf import settings 4 3 5 SESSION_KEY = '_auth_user_id' 4 6 BACKEND_SESSION_KEY = '_auth_user_backend' 5 LOGIN_URL = '/accounts/login/' 7 8 try: 9 LOGIN_URL = settings.LOGIN_URL 10 except AttributeError: 11 LOGIN_URL = '/accounts/login/' 12 13 try: 14 ACCOUNT_URL = settings.ACCOUNT_URL 15 except AttributeError: 16 ACCOUNT_URL = '/accounts/profile/' 17 6 18 REDIRECT_FIELD_NAME = 'next' 7 19 8 20 def load_backend(path):