Added back a modified version of get_fieldsets for liaison forms; in this case the parent class doesn't have this method..
- Legacy-Id: 9011
This commit is contained in:
parent
82fd20bfa2
commit
24abae6d26
|
@ -7,6 +7,8 @@ from django.forms.util import ErrorList
|
|||
from django.core.validators import validate_email, ValidationError
|
||||
from django.template.loader import render_to_string
|
||||
|
||||
import debug # pyflakes:ignore
|
||||
|
||||
from ietf.liaisons.accounts import (can_add_outgoing_liaison, can_add_incoming_liaison,
|
||||
get_person_for_user, is_secretariat, is_sdo_liaison_manager)
|
||||
from ietf.liaisons.utils import IETFHM
|
||||
|
@ -118,6 +120,20 @@ class LiaisonForm(forms.Form):
|
|||
def as_div(self):
|
||||
return render_to_string('liaisons/liaisonform.html', {'form': self})
|
||||
|
||||
def get_fieldsets(self):
|
||||
if not self.fieldsets:
|
||||
yield dict(name=None, fields=self)
|
||||
else:
|
||||
for fieldset, fields in self.fieldsets:
|
||||
fieldset_dict = dict(name=fieldset, fields=[])
|
||||
for field_name in fields:
|
||||
if field_name in self.fields:
|
||||
fieldset_dict['fields'].append(self[field_name])
|
||||
if not fieldset_dict['fields']:
|
||||
# if there is no fields in this fieldset, we continue to next fieldset
|
||||
continue
|
||||
yield fieldset_dict
|
||||
|
||||
def full_clean(self):
|
||||
self.set_required_fields()
|
||||
super(LiaisonForm, self).full_clean()
|
||||
|
|
Loading…
Reference in a new issue