Skip to content

Commit 96fecc3

Browse files
committed
not require strain when updating bioSample
- not require strain when updating bioSample - fix the bug that species is not updated when updating bioSamples with no strain - update liquibase
1 parent 30708c0 commit 96fecc3

3 files changed

Lines changed: 6 additions & 4 deletions

File tree

pegr/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ dependencies {
8686
compile 'org.grails.plugins:external-config:2.0.0'
8787
compile 'org.grails.plugins:excel-export:2.1'
8888
compile fileTree(dir: 'libs', include: '*.jar')
89-
compile 'org.liquibase:liquibase-core:3.6.1'
89+
compile 'org.liquibase:liquibase-core:3.6.3'
9090
testRuntime "org.seleniumhq.selenium:selenium-chrome-driver:$seleniumVersion"
9191
testRuntime "org.seleniumhq.selenium:selenium-firefox-driver:$seleniumVersion"
9292
testRuntime "org.seleniumhq.selenium:selenium-safari-driver:$seleniumSafariDriverVersion"

pegr/grails-app/services/pegr/CellSourceService.groovy

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -129,19 +129,21 @@ class CellSourceService {
129129
def mutationStr = utilityService.cleanString(_mutationStr)
130130

131131
// get the parent strain
132-
def parentStrain = Strain.findByName(parentStrainStr)
132+
def parentStrain = Strain.findBySpeciesAndName(species, parentStrainStr)
133133
if (!parentStrain) {
134134
parentStrain = new Strain(name: parentStrainStr, species: species).save(failOnError: true)
135135
}
136+
136137
// get strain
137-
def strain = Strain.findByNameAndParentAndGenotypeAndGeneticModification(strainStr, parentStrain, genotypeStr, mutationStr)
138+
def strain = Strain.findBySpeciesAndNameAndParentAndGenotypeAndGeneticModification(species, strainStr, parentStrain, genotypeStr, mutationStr)
138139
if (!strain) {
139140
strain = new Strain(name: strainStr,
140141
species: species,
141142
genotype: genotypeStr,
142143
parent: parentStrain,
143144
geneticModification: mutationStr).save( failOnError: true)
144145
}
146+
145147
return strain
146148
}
147149

pegr/grails-app/views/cellSource/_form.gsp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121

2222
<div>
2323
<label>Strain</label>
24-
<select name="strain" class="strain tag-select2 textcontrol" style="width: 150px" required>
24+
<select name="strain" class="strain tag-select2 textcontrol" style="width: 150px">
2525
<option value="${cellSource?.strain}" selected>${cellSource?.strain}</option>
2626
</select>
2727
</div>

0 commit comments

Comments
 (0)