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):