]> git.ozlabs.org Git - patchwork/blobdiff - apps/patchwork/views/user.py
views/user: don't refer to request.POST for non-POST requests
[patchwork] / apps / patchwork / views / user.py
index f9ff7f89a32d011b1d79eee8a9d4ac6c51dc53e8..8358cbd2d752c349c443fa17c938853e8b9819ce 100644 (file)
@@ -63,7 +63,6 @@ def profile(request):
 def link(request):
     context = PatchworkRequestContext(request)
 
-    form = UserPersonLinkForm(request.POST)
     if request.method == 'POST':
         form = UserPersonLinkForm(request.POST)
         if form.is_valid():
@@ -82,6 +81,8 @@ def link(request):
                 context['confirmation'] = None
                 context['error'] = 'An error occurred during confirmation. ' + \
                                    'Please try again later'
+    else:
+        form = UserPersonLinkForm()
     context['linkform'] = form
 
     return render_to_response('patchwork/user-link.html', context)