示例#1
0
 def validateField(self, field_name, new_field_value):
     if field_name == OutputFieldNames.NEW_PROJECTS:
         self.validationErrors.pop(field_name, None)
         if new_field_value:
             errors, trimmed_projectNames = validate_projects(new_field_value)
             if errors:
                 self.validationErrors[field_name] = '\n'.join(errors)
示例#2
0
 def validateField(self, field_name, new_field_value):
     if field_name == OutputFieldNames.NEW_PROJECTS:
         self.validationErrors.pop(field_name, None)
         if new_field_value:
             errors, trimmed_projectNames = validate_projects(new_field_value)
             if errors:
                 self.validationErrors[field_name] = '\n'.join(errors)
示例#3
0
    def validateField(self, field_name, new_field_value):

        if field_name == OutputFieldNames.NEW_PROJECTS:
            self.validationErrors.pop(field_name, None)
            if new_field_value:
                errors, trimmed_projectNames = validate_projects(
                    new_field_value,
                    field_label=_(
                        "workflow.step.output.fields.projectName.label"),
                )
                if errors:
                    self.validationErrors[field_name] = "\n".join(errors)
示例#4
0
def _validate_projects(input, selectedTemplate, planObj):
    """
    validate projects case-insensitively with leading/trailing blanks in the input ignored
    """            
    
    errorMsg = None
    projects = ''
    
    if input:
        value = input.strip()
        errors, trimmed_projects = validate_projects(value, delim=";")
        if errors:
            errorMsg = '  '.join(errors)
        else:
            projects = trimmed_projects.replace(";",",")

    return errorMsg, projects
示例#5
0
def _validate_projects(input, selectedTemplate, planObj):
    """
    validate projects case-insensitively with leading/trailing blanks in the input ignored
    """            
    
    errorMsg = None
    projects = ''
    
    if input:
        value = input.strip()
        errors, trimmed_projects = validate_projects(value, delim=";")
        if errors:
            errorMsg = '  '.join(errors)
        else:
            projects = trimmed_projects.replace(";",",")

    return errorMsg, projects