diff --git a/django/views/auth/login.py b/django/views/auth/login.py index 3f2bd43015..4a356ff93f 100644 --- a/django/views/auth/login.py +++ b/django/views/auth/login.py @@ -1,8 +1,8 @@ from django.parts.auth.formfields import AuthenticationForm from django.core import formfields from django.core.extensions import DjangoContext, render_to_response -from django.models.auth import users -from django.models.core import sites +from django.models.auth import SESSION_KEY +from django.models.core import Site from django.utils.httpwrappers import HttpResponse, HttpResponseRedirect REDIRECT_FIELD_NAME = 'next' @@ -18,7 +18,7 @@ def login(request): # Light security check -- make sure redirect_to isn't garbage. if not redirect_to or '://' in redirect_to or ' ' in redirect_to: redirect_to = '/accounts/profile/' - request.session[users.SESSION_KEY] = manipulator.get_user_id() + request.session[SESSION_KEY] = manipulator.get_user_id() request.session.delete_test_cookie() return HttpResponseRedirect(redirect_to) else: @@ -27,13 +27,13 @@ def login(request): return render_to_response('registration/login', { 'form': formfields.FormWrapper(manipulator, request.POST, errors), REDIRECT_FIELD_NAME: redirect_to, - 'site_name': sites.get_current().name, + 'site_name': Site.objects.get_current().name, }, context_instance=DjangoContext(request)) def logout(request, next_page=None): "Logs out the user and displays 'You are logged out' message." try: - del request.session[users.SESSION_KEY] + del request.session[SESSION_KEY] except KeyError: return render_to_response('registration/logged_out', context_instance=DjangoContext(request)) else: diff --git a/django/views/core/__init__.py b/django/views/core/__init__.py deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/django/views/registration/passwords.py b/django/views/registration/passwords.py index 65bacafd98..449e5c7952 100644 --- a/django/views/registration/passwords.py +++ b/django/views/registration/passwords.py @@ -1,7 +1,7 @@ from django.core import formfields, validators from django.core.extensions import DjangoContext, render_to_response from django.core.template import Context, loader -from django.models.auth import users +from django.models.auth import User from django.views.decorators.auth import login_required from django.utils.httpwrappers import HttpResponseRedirect @@ -16,15 +16,15 @@ class PasswordResetForm(formfields.Manipulator): def isValidUserEmail(self, new_data, all_data): "Validates that a user exists with the given e-mail address" try: - self.user_cache = users.get_object(email__iexact=new_data) - except users.UserDoesNotExist: + self.user_cache = User.objects.get_object(email__iexact=new_data) + except User.DoesNotExist: raise validators.ValidationError, "That e-mail address doesn't have an associated user acount. Are you sure you've registered?" def save(self, domain_override=None): "Calculates a new password randomly and sends it to the user" from django.core.mail import send_mail from django.models.core import sites - new_pass = users.make_random_password() + new_pass = User.objects.make_random_password() self.user_cache.set_password(new_pass) self.user_cache.save() if not domain_override: