From 07fb6d66e3644144617ffa66c252a542a7ef3c92 Mon Sep 17 00:00:00 2001 From: Galen Date: Fri, 1 Nov 2024 11:31:03 -0700 Subject: [PATCH] swap negative check of dict for postivie, re #11583 --- arches/app/models/resource.py | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/arches/app/models/resource.py b/arches/app/models/resource.py index 3257d22f9b..6187922b70 100644 --- a/arches/app/models/resource.py +++ b/arches/app/models/resource.py @@ -902,15 +902,18 @@ def get_relations( and str(resourceinstancefrom_graphid) in readable_graphids ): try: - if f'{relation["relationshiptype"]}{lang}' not in preflabel_lookup: + if f'{relation["relationshiptype"]}{lang}' in preflabel_lookup: + preflabel = preflabel_lookup[ + f'{relation["relationshiptype"]}{lang}' + ] + else: + preflabel = get_preflabel_from_valueid( + relation["relationshiptype"], lang + ) preflabel_lookup[f'{relation["relationshiptype"]}{lang}'] = ( - get_preflabel_from_valueid( - relation["relationshiptype"], lang - ) + preflabel ) - preflabel = preflabel_lookup[ - f'{relation["relationshiptype"]}{lang}' - ] + relation["relationshiptype_label"] = preflabel["value"] or "" except: relation["relationshiptype_label"] = (