Esempio n. 1
0
    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)
Esempio n. 2
0
    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)