From 09a5ae8c522b993f82862e68bc02e0de08c297e4 Mon Sep 17 00:00:00 2001
From: Yves Noirjean <yves.noirjean@id.ethz.ch>
Date: Tue, 14 Aug 2018 17:35:24 +0200
Subject: [PATCH] SSDM-6986: pybis - saving semantic annotations when creating
 them from sample type

---
 pybis/src/python/pybis/sample_type.py | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/pybis/src/python/pybis/sample_type.py b/pybis/src/python/pybis/sample_type.py
index 3bebbd4e070..83491132777 100644
--- a/pybis/src/python/pybis/sample_type.py
+++ b/pybis/src/python/pybis/sample_type.py
@@ -5,11 +5,13 @@ class SampleType(PropertyAssignments):
     """ Helper class for sample types, adding functionality.
     """
 
-    def new_semantic_annotation(self, **kwargs):
-        return SemanticAnnotation(
+    def add_semantic_annotation(self, **kwargs):
+        semantic_annotation = SemanticAnnotation(
             openbis_obj=self.openbis, isNew=True, 
             entityType=self.code, **kwargs
         )
+        semantic_annotation.save()
+        return semantic_annotation
 
     def get_semantic_annotations(self):
         return self.openbis.search_semantic_annotations(entityType=self.code)
-- 
GitLab