def validateField(self, field_name, new_field_value): ''' Flows qc value must be a positive integer Chip type is required ''' if field_name == KitsFieldNames.FLOWS: errors = validate_flows(new_field_value) if errors: self.validationErrors[field_name] = ' '.join(errors) else: self.validationErrors.pop(field_name, None) if field_name == KitsFieldNames.CHIP_TYPE and self.prepopulatedFields.get( 'is_chipType_required', True): if validation.has_value(new_field_value): self.validationErrors.pop(field_name, None) else: self.validationErrors[field_name] = validation.required_error( "Chip Type") if field_name == KitsFieldNames.TEMPLATE_KIT_NAME: if validation.has_value(new_field_value): self.validationErrors.pop(field_name, None) else: self.validationErrors[field_name] = validation.required_error( "Template Kit")
def validateField(self, field_name, new_field_value): """ Flows qc value must be a positive integer Chip type is required """ if field_name == KitsFieldNames.FLOWS: errors = validate_flows( new_field_value, field_label=_("workflow.step.kits.fields.flows.label")) if errors: self.validationErrors[field_name] = " ".join(errors) else: self.validationErrors.pop(field_name, None) if field_name == KitsFieldNames.CHIP_TYPE and self.prepopulatedFields.get( "is_chipType_required", True): if validation.has_value(new_field_value): self.validationErrors.pop(field_name, None) else: self.validationErrors[field_name] = validation.required_error( _("workflow.step.kits.fields.chipType.label") ) # "Chip Type" if field_name == KitsFieldNames.TEMPLATE_KIT_NAME: if validation.has_value(new_field_value): self.validationErrors.pop(field_name, None) else: self.validationErrors[field_name] = validation.required_error( _("workflow.step.kits.fields.templatekitname.label") ) # "Template Kit" if field_name == KitsFieldNames.LIBRARY_READ_LENGTH: errors = validate_libraryReadLength( new_field_value, field_label=_( "workflow.step.kits.fields.libraryReadLength.label"), ) if errors: self.validationErrors[field_name] = " ".join(errors) else: self.validationErrors.pop(field_name, None) if field_name == KitsFieldNames.READ_LENGTH: if new_field_value: errors = validate_libraryReadLength( new_field_value, field_label=_( "workflow.step.kits.fields.readLength.label"), ) if errors: self.validationErrors[field_name] = " ".join(errors) else: self.validationErrors.pop(field_name, None) self.savedFields[ KitsFieldNames.LIBRARY_READ_LENGTH] = new_field_value
def _validate_flows(input, selectedTemplate, planObj): """ validate flow value with leading/trailing blanks in the input ignored """ errorMsg = None if input: value = input.strip() errors = validate_flows(value) if errors: errorMsg = ' '.join(errors) else: planObj.get_expObj().flows = int(value) return errorMsg
def validateField(self, field_name, new_field_value): ''' Flows qc value must be a positive integer Chip type is required ''' if field_name == KitsFieldNames.FLOWS: errors = validate_flows(new_field_value) if errors: self.validationErrors[field_name] = ' '.join(errors) else: self.validationErrors.pop(field_name, None) if field_name == KitsFieldNames.CHIP_TYPE and self.prepopulatedFields.get( 'is_chipType_required', True): if validation.has_value(new_field_value): self.validationErrors.pop(field_name, None) else: self.validationErrors[field_name] = validation.required_error( "Chip Type") if field_name == KitsFieldNames.TEMPLATE_KIT_NAME: if validation.has_value(new_field_value): self.validationErrors.pop(field_name, None) else: self.validationErrors[field_name] = validation.required_error( "Template Kit") if field_name == KitsFieldNames.LIBRARY_READ_LENGTH: errors = validate_libraryReadLength(new_field_value) if errors: self.validationErrors[field_name] = ' '.join(errors) else: self.validationErrors.pop(field_name, None) if field_name == KitsFieldNames.READ_LENGTH: if new_field_value: errors = validate_libraryReadLength(new_field_value) if errors: self.validationErrors[field_name] = ' '.join(errors) else: self.validationErrors.pop(field_name, None) self.savedFields[ KitsFieldNames.LIBRARY_READ_LENGTH] = new_field_value if field_name == KitsFieldNames.TEMPLATING_SIZE: errors = validate_templatingSize(new_field_value) if errors: self.validationErrors[field_name] = ' '.join(errors) else: self.validationErrors.pop(field_name, None)
def validateField(self, field_name, new_field_value): ''' Flows qc value must be a positive integer Chip type is required ''' if field_name == KitsFieldNames.FLOWS: errors = validate_flows(new_field_value) if errors: self.validationErrors[field_name] = ' '.join(errors) else: self.validationErrors.pop(field_name, None) if field_name == KitsFieldNames.CHIP_TYPE and self.prepopulatedFields.get('is_chipType_required',True): if validation.has_value(new_field_value): self.validationErrors.pop(field_name, None) else: self.validationErrors[field_name] = validation.required_error("Chip Type") if field_name == KitsFieldNames.TEMPLATE_KIT_NAME: if validation.has_value(new_field_value): self.validationErrors.pop(field_name, None) else: self.validationErrors[field_name] = validation.required_error("Template Kit") if field_name == KitsFieldNames.LIBRARY_READ_LENGTH: errors = validate_libraryReadLength(new_field_value) if errors: self.validationErrors[field_name] = ' '.join(errors) else: self.validationErrors.pop(field_name, None) if field_name == KitsFieldNames.READ_LENGTH: if new_field_value: errors = validate_libraryReadLength(new_field_value) if errors: self.validationErrors[field_name] = ' '.join(errors) else: self.validationErrors.pop(field_name, None) self.savedFields[KitsFieldNames.LIBRARY_READ_LENGTH] = new_field_value if field_name == KitsFieldNames.TEMPLATING_SIZE: errors = validate_templatingSize(new_field_value) if errors: self.validationErrors[field_name] = ' '.join(errors) else: self.validationErrors.pop(field_name, None)
def validateField(self, field_name, new_field_value): ''' Flows qc value must be a positive integer Chip type is required ''' if field_name == KitsFieldNames.FLOWS: errors = validate_flows(new_field_value) if errors: self.validationErrors[field_name] = ' '.join(errors) else: self.validationErrors.pop(field_name, None) if field_name == KitsFieldNames.CHIP_TYPE and self.prepopulatedFields.get('is_chipType_required',True): if validation.has_value(new_field_value): self.validationErrors.pop(field_name, None) else: self.validationErrors[field_name] = validation.required_error("Chip Type") if field_name == KitsFieldNames.TEMPLATE_KIT_NAME: if validation.has_value(new_field_value): self.validationErrors.pop(field_name, None) else: self.validationErrors[field_name] = validation.required_error("Template Kit")