From b9f277ce779e523469942bed32bd4bf7557504d8 Mon Sep 17 00:00:00 2001 From: Birger Schacht Date: Tue, 7 May 2024 14:36:44 +0200 Subject: [PATCH] fix(apis_relations): catch missing RootObject in relation representation --- apis_core/apis_relations/models.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apis_core/apis_relations/models.py b/apis_core/apis_relations/models.py index 2f0bbb5f0..3ff009560 100644 --- a/apis_core/apis_relations/models.py +++ b/apis_core/apis_relations/models.py @@ -256,9 +256,9 @@ class Triple(models.Model, GenericModel): objects_inheritance = InheritanceManager() def __repr__(self): - if self.subj is not None or self.obj is not None or self.prop is not None: + try: return f"<{self.__class__.__name__}: subj: {self.subj}, prop: {self.prop}, obj: {self.obj}>" - else: + except RootObject.DoesNotExist: return f"<{self.__class__.__name__}: None>" def __str__(self):