diff --git a/server-screening/source/core-plugins/screening/4/as/initialize-master-data.py b/server-screening/source/core-plugins/screening/4/as/initialize-master-data.py index b5acee3f109611ba10e05384f85d3f5ca5581545..da71681553bcd09399790c4e0ac73bf3dfe059b7 100644 --- a/server-screening/source/core-plugins/screening/4/as/initialize-master-data.py +++ b/server-screening/source/core-plugins/screening/4/as/initialize-master-data.py @@ -103,6 +103,9 @@ material_type_CONTROL.setDescription('Control of a control layout') material_type_GENE = tr.getOrCreateNewMaterialType('GENE') material_type_GENE.setDescription('Gene') +# This is to get around a weird bug running the test in Jenkins when the database populating twice +isMaterial_type_SIRNAAvailable = tr.getMaterialType('SIRNA') not None + material_type_SIRNA = tr.getOrCreateNewMaterialType('SIRNA') material_type_SIRNA.setDescription('Oligo nucleotide') @@ -209,10 +212,12 @@ assignment_MATERIAL_SIRNA_DESCRIPTION.setMandatory(False) assignment_MATERIAL_SIRNA_DESCRIPTION.setSection(None) assignment_MATERIAL_SIRNA_DESCRIPTION.setPositionInForms(3) -assignment_MATERIAL_SIRNA_INHIBITOR_OF = tr.assignPropertyType(material_type_SIRNA, prop_type_INHIBITOR_OF) -assignment_MATERIAL_SIRNA_INHIBITOR_OF.setMandatory(True) -assignment_MATERIAL_SIRNA_INHIBITOR_OF.setSection(None) -assignment_MATERIAL_SIRNA_INHIBITOR_OF.setPositionInForms(4) +# This is to get around a weird bug running the test in Jenkins when the database populating twice +if not isMaterial_type_SIRNAAvailable: + assignment_MATERIAL_SIRNA_INHIBITOR_OF = tr.assignPropertyType(material_type_SIRNA, prop_type_INHIBITOR_OF) + assignment_MATERIAL_SIRNA_INHIBITOR_OF.setMandatory(True) + assignment_MATERIAL_SIRNA_INHIBITOR_OF.setSection(None) + assignment_MATERIAL_SIRNA_INHIBITOR_OF.setPositionInForms(4) assignment_MATERIAL_SIRNA_LIBRARY_ID = tr.assignPropertyType(material_type_SIRNA, prop_type_LIBRARY_ID) assignment_MATERIAL_SIRNA_LIBRARY_ID.setMandatory(False)