Commits

offline committed f291795

confirmation bugfix. issue #5

Comments (0)

Files changed (1)

openauth/views.py

 
     if form.is_valid():
         user = form.save()
-        activation = Confirmation(user=user, key=generate_hash())
-        activation.save()
+        confirmation = Confirmation.objects.create(user, openauth.settings.ACTIVATION_CONFIRMATION_TYPE)
+        confirmation.save()
         url = request.build_absolute_uri(reverse('openauth-confirm'))
-        url += '?key=%s' % activation.key
+        url += '?key=%s' % confirmation.key
         params = {'domain': 'localhost:8000', 'email': user.email, 'url': url}
         email_template(user.email, 'openauth/mail/registration.txt', **params)
-        request.flash['notice'] = "You have successfully registered. Check your inbox for email with activation link."
         del request.session['authenticated_openid_url']
-        redirect_url = build_redirect_url(request, reverse('openauth-show-user', args=[user.id]))
-        return redirect(redirect_url)
+        return notify_user.success(request, "openauth-show-user", openauth.lang.PLEASE_ACTIVATE)
 
     return {'form': form, 'openid_url': openid_url}