

def clean_parameter_list(self, *args, **kwargs):
    list_id = self.cleaned_data['parameter_list']
    parameter_list = ParameterList.objects.get(id=list_id)
    workflow_tasks = order_workflow_tasks(self.workflow)
    all_required_inputs = []
    for wf_task in workflow_tasks:
        for (name, data_type) in wf_task.task.required_inputs.iteritems():
            if (name not in all_required_inputs):
                all_required_inputs.append((name, data_type))
    all_parameters = []
    for parameter in parameter_list.parameters.all():
        all_parameters.append((parameter.name, parameter.data_type))
    if (not (False not in [(e in all_parameters) for e in all_required_inputs])):
        error_message = 'Not all required inputs found in ParameterList.'
        error_message += '<br><br><strong>Required inputs by the Tasks are</strong>:'
        for param in all_required_inputs:
            error_message += ((('<br>' + str(param[0])) + ':') + str(param[1]))
        error_message += '<br><br><strong>List contains</strong>:'
        for param in all_parameters:
            error_message += ((('<br>' + str(param[0])) + ':') + str(param[1]))
        raise forms.ValidationError(mark_safe(error_message))
    return list_id

dataset/ETHPy150Open 3bot/3bot/threebot/forms.py ParameterListSelectForm.clean_parameter_list/original