Skip to content
Snippets Groups Projects
Commit ef6b2d58 authored by juanf's avatar juanf
Browse files

SSDM-1932 : Bugfix on children generator

SVN: 34018
parent 028fffe4
No related branches found
No related tags found
No related merge requests found
......@@ -395,9 +395,11 @@ def insertUpdateSample(tr, parameters, tableBuilder):
sample.setParentSampleIdentifiers(sampleParents);
#Create new sample children
sampleChildrenNewIdentifiers = [];
if sampleChildrenNew != None:
for newSampleChild in sampleChildrenNew:
child = tr.createNewSample(newSampleChild["identifier"], newSampleChild["sampleTypeCode"]); #Create Sample given his id
sampleChildrenNewIdentifiers.append(newSampleChild["identifier"]);
child.setParentSampleIdentifiers([sampleIdentifier]);
for key in newSampleChild["properties"].keySet():
propertyValue = unicode(newSampleChild["properties"][key]);
......@@ -406,11 +408,11 @@ def insertUpdateSample(tr, parameters, tableBuilder):
child.setPropertyValue(key,propertyValue);
#Add sample children
#Add sample children that are not newly created
if sampleChildren != None:
for sampleChildIdentifier in sampleChildren:
child = getSampleByIdentifierForUpdate(tr, sampleChildIdentifier); #Retrieve Sample
if child != None: #The new created ones will not be found
if sampleChildIdentifier not in sampleChildrenNewIdentifiers:
child = getSampleByIdentifierForUpdate(tr, sampleChildIdentifier); #Retrieve Sample
childParents = child.getParentSampleIdentifiers();
childParents.add(sampleIdentifier);
child.setParentSampleIdentifiers(childParents);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment