From 5780aba2c8aa947f02fdfc3f981c803cf03bbc8f Mon Sep 17 00:00:00 2001
From: Alex <akreft@trineo.org>
Date: Tue, 27 Apr 2021 10:41:33 +0200
Subject: [PATCH] Solve Issue #46

---
 src/caosdb/common/datatype.py | 2 ++
 src/caosdb/common/models.py   | 2 +-
 2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/caosdb/common/datatype.py b/src/caosdb/common/datatype.py
index eb8c1e4e..f8864539 100644
--- a/src/caosdb/common/datatype.py
+++ b/src/caosdb/common/datatype.py
@@ -45,6 +45,8 @@ def LIST(datatype):
 
 def get_list_datatype(datatype):
     """ returns the datatype of the elements in the list """
+    if not isinstance(datatype, str):
+        return None
     match = re.match("LIST(<|&lt;)(?P<datatype>.*)(>|&gt;)", datatype)
 
     if match is not None:
diff --git a/src/caosdb/common/models.py b/src/caosdb/common/models.py
index 731ac751..67a38321 100644
--- a/src/caosdb/common/models.py
+++ b/src/caosdb/common/models.py
@@ -2814,7 +2814,7 @@ class Container(list):
             for parents in container_item.get_parents():
                 is_parent.add(parents.id)
             for references in container_item.get_properties():
-                if is_reference(str(references.datatype)):
+                if is_reference(references.datatype):
                     # add only if it is a reference, not a property
                     if(isinstance(references.value, int)):
                         has_references.add(references.value)
-- 
GitLab