def clean_default_service(self):
        enabled_services = set(self.cleaned_data['enabled_services'])
        service_id = self.cleaned_data['default_service']

        if service_id == 'none':
            default_service = None
        else:
            if not avatar_services.has_service(service_id):
                raise ValidationError('Unknown service "%s".' % service_id)
            elif service_id not in enabled_services:
                raise ValidationError('Cannot set disabled service "%s" to '
                                      'default.'
                                      % service_id)

            default_service = avatar_services.get('avatar_service_id',
                                                  service_id)

        return default_service
Clean the default_service field.
dataset/ETHPy150Open reviewboard/reviewboard/reviewboard/admin/forms.py/AvatarServicesForm.clean_default_service