def full_clean(self):
        cache_type = self['cache_type'].data or self['cache_type'].initial

        for iter_cache_type, field in six.iteritems(
                self.CACHE_LOCATION_FIELD_MAP):
            self.fields[field].required = (cache_type == iter_cache_type)

        return super(GeneralSettingsForm, self).full_clean()
Clean and validate all form fields.
dataset/ETHPy150Open reviewboard/reviewboard/reviewboard/admin/forms.py/GeneralSettingsForm.full_clean