From 627f5aca263da2513fe6d592becd3b505d97dd21 Mon Sep 17 00:00:00 2001 From: Jeremy Kerr Date: Sun, 30 Dec 2012 13:57:18 +0800 Subject: 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 --- apps/patchwork/views/__init__.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) 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() -- cgit v1.2.3