Commit 73960c43 authored by Jeremy Kerr's avatar Jeremy Kerr
Browse files

forms.MultiplePatchForm: remove no-change fields on clean()

We need to remove no-change fields, as newer versions of django are
checking for proper types on validation.

Fixes MultipleUpdateTest.

Signed-off-by: default avatarJeremy Kerr <>
parent f7535e70
......@@ -186,6 +186,21 @@ class MultiplePatchForm(PatchForm):
self.fields['delegate'] = OptionalDelegateField(project = project,
required = False)
def _clean_fields(self):
super(MultiplePatchForm, self)._clean_fields()
# remove optional fields
opts = self.instance._meta
for f in opts.fields:
if not in self.cleaned_data:
field = self.fields.get(, None)
if field is None:
if field.is_no_change(self.cleaned_data[]):
del self.cleaned_data[]
def save(self, instance, commit = True):
opts = instance.__class__._meta
if self.errors:
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment