Commits

Tino de Bruijn  committed 781b9b4

Updated user messages to the django.contrib.messages app new in django 1.2

  • Participants
  • Parent commits e87699d
  • Tags 0.2

Comments (0)

Files changed (1)

File user_creation/views.py

 from django.conf import settings
-from django.core.urlresolvers import reverse
 from django.http import HttpResponseRedirect
-from django.shortcuts import render_to_response
-from django.template import RequestContext
 from django.utils.translation import ugettext as _
 from django.contrib.auth import login, authenticate
 from django.template.response import TemplateResponse
+from django.contrib import messages
+
 from forms import SetPasswordForm
 from models import ActivationProfile
 
                 user = authenticate(username=account.username, password=form.cleaned_data['new_password1'])
                 user.backend = settings.AUTHENTICATION_BACKENDS[0]
                 login(request, user)
-                request.user.message_set.create(message=_("Your password has been set, \
+                messages.success(request, _("Your password has been set, \
                     please remember to remember it. You are now logged in."))
                 return HttpResponseRedirect(getattr(settings, 'LOGIN_REDIRECT_URL','/'))
             else: