]> git.ozlabs.org Git - patchwork/commitdiff
Save confirmation object before trying to render user-link email
authorJeremy Kerr <jk@ozlabs.org>
Thu, 11 Sep 2008 07:11:29 +0000 (17:11 +1000)
committerJeremy Kerr <jk@ozlabs.org>
Thu, 11 Sep 2008 07:11:29 +0000 (17:11 +1000)
We need the key, which is generated in save()

Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
apps/patchwork/views/user.py

index b042d35b2f8a433984a981e60f55c1b50c68c114..f9ff7f89a32d011b1d79eee8a9d4ac6c51dc53e8 100644 (file)
@@ -69,6 +69,7 @@ def link(request):
         if form.is_valid():
             conf = UserPersonConfirmation(user = request.user,
                     email = form.cleaned_data['email'])
+            conf.save()
             context['confirmation'] = conf
 
             try:
@@ -77,7 +78,6 @@ def link(request):
                                 context),
                             settings.DEFAULT_FROM_EMAIL,
                             [form.cleaned_data['email']])
-                conf.save()
             except Exception, ex:
                 context['confirmation'] = None
                 context['error'] = 'An error occurred during confirmation. ' + \