diff options
author | Jeremy Kerr <jk@ozlabs.org> | 2008-08-23 10:25:43 +0800 |
---|---|---|
committer | Jeremy Kerr <jk@ozlabs.org> | 2008-08-23 10:25:43 +0800 |
commit | f1f11ba9e5511d5c0534929ed435baee994ff68b (patch) | |
tree | 9bf8bab7b695807f6d2adf8523a5f17bf4ce03bc /apps/patchwork/forms.py | |
parent | aec7cf5771cd3244e024aada3b51a3d58b1af2f0 (diff) | |
download | patchwork-f1f11ba9e5511d5c0534929ed435baee994ff68b.tar.bz2 patchwork-f1f11ba9e5511d5c0534929ed435baee994ff68b.tar.xz |
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: Jeremy Kerr <jk@ozlabs.org>
Diffstat (limited to 'apps/patchwork/forms.py')
-rw-r--r-- | apps/patchwork/forms.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/apps/patchwork/forms.py b/apps/patchwork/forms.py index 18c6a5e..7385ced 100644 --- a/apps/patchwork/forms.py +++ b/apps/patchwork/forms.py @@ -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 |