1. Bryan O'Sullivan
  2. patchwork

Commits

Jeremy Kerr  committed 081b6a0

forms: Only pass post data to multiplepatchform if that was what was submitted

When updating bundles, we get a spurious error message in the
MultiplePatchForm; it's performing validation on the blank form data.

This change only passes the post data to the MuliplePatchForm if we
detect (through data['form']) that it was the MultiplePatchForm that was
submitted.

This fixes the current testsuite failure.

Signed-off-by: Jeremy Kerr <jk@ozlabs.org>

  • Participants
  • Parent commits 68c9a19
  • Branches default

Comments (0)

Files changed (1)

File apps/patchwork/views/__init__.py

View file
     user = request.user
     properties_form = None
     if project.is_editable(user):
-        properties_form = MultiplePatchForm(project, data = data)
+
+        # we only pass the post data to the MultiplePatchForm if that was
+        # the actual form submitted
+        data_tmp = None
+        if data and data.get('form', '') == 'patchlistform':
+            data_tmp = data
+
+        properties_form = MultiplePatchForm(project, data = data_tmp)
 
     if request.method == 'POST' and data.get('form') == 'patchlistform':
         action = data.get('action', '').lower()