magic-removal: Removed django/views/core, which was empty

git-svn-id: http://code.djangoproject.com/svn/django/branches/magic-removal@1659 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
Adrian Holovaty 2005-12-15 00:33:33 +00:00
parent 8f696be3b7
commit bdb1776a8f
3 changed files with 9 additions and 9 deletions

View File

@ -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:

View File

@ -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: