From 4b1e3dae82b2ce3f9bda8958cadc18bfc5908645 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Henrik=20tom=20W=C3=B6rden?= <h.tomwoerden@indiscale.com>
Date: Sun, 19 Jul 2020 14:56:01 +0200
Subject: [PATCH] FIX: allow non unique names

---
 src/caosadvancedtools/crawler.py | 25 ++++++++++++-------------
 1 file changed, 12 insertions(+), 13 deletions(-)

diff --git a/src/caosadvancedtools/crawler.py b/src/caosadvancedtools/crawler.py
index 4e88de13..12f3be81 100644
--- a/src/caosadvancedtools/crawler.py
+++ b/src/caosadvancedtools/crawler.py
@@ -138,7 +138,7 @@ class Crawler(object):
             if current_xml != old:
                 continue
 
-            new_cont.update()
+            new_cont.update(unique=False)
 
     def collect_cfoods(self):
         """
@@ -539,18 +539,17 @@ carefully and if the changes are ok, click on the following link:
         used for the match.
         """
 
-        if entity.name is None:
-            # TODO multiple parents are ignored! Sufficient?
-            query_string = "FIND Record " + entity.get_parents()[0].name
-            query_string += " WITH "
-
-            for p in entity.get_properties():
-                query_string += ("'" + p.name + "'='" + str(get_value(p))
-                                     + "' AND ")
-            # remove the last AND
-            query_string = query_string[:-4]
-        else:
-            query_string = "FIND '{}'".format(entity.name)
+        # TODO multiple parents are ignored! Sufficient?
+        query_string = "FIND Record " + entity.get_parents()[0].name
+        query_string += " WITH "
+        if entity.name is not None:
+            query_string += "name='{}' AND".format(entity.name)
+
+        for p in entity.get_properties():
+            query_string += ("'" + p.name + "'='" + str(get_value(p))
+                             + "' AND ")
+        # remove the last AND
+        query_string = query_string[:-4]
 
         logger.debug(query_string)
         q = db.Query(query_string)
-- 
GitLab