def clean(self):
            try:
                paymentmethod = self.cleaned_data['paymentmethod']
            except __HOLE__:
                self._errors['paymentmethod'] = forms.util.ErrorList([_('This field is required')])
                return self.cleaned_data
            required_fields = self.payment_required_fields.get(paymentmethod, [])
            msg = _('Selected payment method requires this field to be filled')
            for fld in required_fields:
                if not (self.cleaned_data.has_key(fld) and self.cleaned_data[fld]):
                    self._errors[fld] = forms.util.ErrorList([msg])
                elif fld == 'state':
                    self.enforce_state = True
                    try:
                        self._check_state(self.cleaned_data['state'], self.cleaned_data['country'])
                    except forms.ValidationError, e:
                        self._errors[fld] = e.messages
            super(PaymentContactInfoForm, self).clean()
            return self.cleaned_data
dataset/ETHPy150Open dokterbob/satchmo/satchmo/apps/payment/forms.py/PaymentContactInfoForm.clean