Commit f1f11ba9 authored by Jeremy Kerr's avatar Jeremy Kerr
Browse files

Use self.fields[field] rather than self.field when iterating form fields



This way, we included the delegate field added in the
MultiplePatchForm's constructor.
Signed-off-by: default avatarJeremy Kerr <jk@ozlabs.org>
parent aec7cf57
......@@ -171,7 +171,8 @@ class MultiplePatchForm(PatchForm):
def __init__(self, project, *args, **kwargs):
super(MultiplePatchForm, self).__init__(project = project,
*args, **kwargs)
self.fields['delegate'] = OptionalDelegateField(project = project)
self.fields['delegate'] = OptionalDelegateField(project = project,
required = False)
def save(self, instance, commit = True):
opts = instance.__class__._meta
......@@ -184,7 +185,7 @@ class MultiplePatchForm(PatchForm):
if not f.name in data:
continue
field = getattr(self, f.name, None)
field = self.fields.get(f.name, None)
if not field:
continue
......
Markdown is supported
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