diff options
author | Jeremy Kerr <jk@ozlabs.org> | 2012-12-30 13:57:18 +0800 |
---|---|---|
committer | Jeremy Kerr <jk@ozlabs.org> | 2012-12-30 13:59:52 +0800 |
commit | 627f5aca263da2513fe6d592becd3b505d97dd21 (patch) | |
tree | cb783b8687d61b62b10e1352a9c4dcf52d4229d0 | |
parent | d0fca5754590a0322b27152269a1f9bc71690bf7 (diff) | |
download | patchwork-627f5aca263da2513fe6d592becd3b505d97dd21.tar patchwork-627f5aca263da2513fe6d592becd3b505d97dd21.tar.gz |
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>
-rw-r--r-- | apps/patchwork/views/__init__.py | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/apps/patchwork/views/__init__.py b/apps/patchwork/views/__init__.py index bae40c6..a9943e7 100644 --- a/apps/patchwork/views/__init__.py +++ b/apps/patchwork/views/__init__.py @@ -44,7 +44,14 @@ def generic_list(request, project, view, 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() |