diff --git a/unifier/views.py b/unifier/views.py index a125bc240d0d1742593adebfe695641591f432ac..6f105c523c028d33f76f842e515863f5127862d5 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):