]> git.ozlabs.org Git - patchwork/commitdiff
Use self.fields[field] rather than self.field when iterating form fields
authorJeremy Kerr <jk@ozlabs.org>
Sat, 23 Aug 2008 02:25:43 +0000 (10:25 +0800)
committerJeremy Kerr <jk@ozlabs.org>
Sat, 23 Aug 2008 02:25:43 +0000 (10:25 +0800)
This way, we included the delegate field added in the
MultiplePatchForm's constructor.

Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
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