]> git.ozlabs.org Git - patchwork/blobdiff - apps/patchwork/forms.py
Use self.fields[field] rather than self.field when iterating form fields
[patchwork] / apps / patchwork / forms.py
index 18c6a5ef0aa30c0f5d9ba204370f4b410a8eb776..7385ced14b4337f7030f46286fe5b948b99a064a 100644 (file)
@@ -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