

def clean(self):
    cleaned_data = super(WorkerSelectForm, self).clean()
    worker_ids = cleaned_data.get('worker')
    workers = Worker.objects.filter(id__in=worker_ids)
    for worker in workers:
        if (not worker.is_accessible):
            raise forms.ValidationError('worker not aceccible')
    return cleaned_data

dataset/ETHPy150Open 3bot/3bot/threebot/forms.py WorkerSelectForm.clean/original