

def __init__(self, *args, **kwargs):
    request = kwargs.pop('request')
    workflow = kwargs.pop('workflow')
    super(WorkerSelectForm, self).__init__(*args, **kwargs)
    possible_workers = get_possible_worker(request, as_list=True)
    preset_worker = get_preset_worker(request, workflow, flat=True)
    self.fields['worker'] = forms.MultipleChoiceField(required=True, label='Worker', choices=possible_workers, initial=preset_worker, widget=forms.SelectMultiple(attrs={
        'class': 'form-control',
    }))
    self.fields['worker'].empty_label = None
    if (len(possible_workers) <= 0):
        self.cleaned_data = {
            
        }
        msg = 'No Worker found. Please configure a Worker first.'
        self.add_error('worker', msg)

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