From b5b2598995409f8f192d5bbb31c7e5483edcc9a6 Mon Sep 17 00:00:00 2001
From: dcz <dcz@ipipan.waw.pl>
Date: Tue, 24 Oct 2023 15:58:53 +0200
Subject: [PATCH] Hierarchy constraint check improvement (accetp synsets
 overlaping).

---
 unifier/views.py | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/unifier/views.py b/unifier/views.py
index a125bc2..6f105c5 100644
--- a/unifier/views.py
+++ b/unifier/views.py
@@ -89,17 +89,18 @@ def check_sysnet_hierarchy_constraints(synset_preference_ids, unified_frame_argu
     for synset_preference_id in synset_preference_ids:
         conflict_hyponym, conflict_hyperonym, conflict_exists = synset_hierarchy_constraint_check(int(synset_preference_id),
                                                                                  set(synset_ids_list))
-        if conflict_hyponym is not None or conflict_hyperonym is not None or conflict_exists is not None:
-
+        if conflict_hyponym is None and conflict_hyperonym is None and conflict_exists is None:
+            return {"succ": True}
+        else:
             conflict_exists_lu_str = conflict_lu_to_str(conflict_exists)
             conflict_hyponym_lu_str = conflict_lu_to_str(conflict_hyponym)
             conflict_hyperonym_lu_str = conflict_lu_to_str(conflict_hyperonym)
 
-            return {"succ": False, "conflict_hyponym": conflict_hyponym_lu_str,
+            ret = {"succ": False, "conflict_hyponym": conflict_hyponym_lu_str,
                                    "conflict_hyperonym": conflict_hyperonym_lu_str,
                                    "conflict_exists": "Wybrana preferencja selekcyjna nie mogła zostać zapisana ponieważ widnieje już na liście preferencji selekcyjnych: " + conflict_exists_lu_str if conflict_exists_lu_str is not None else None}
 
-    return {"succ": True}
+    return ret
 
 
 def conflict_lu_to_str(conflict_lu):
-- 
GitLab