Skip to content

Commit

Permalink
fix(apis_relations): catch missing RootObject in relation representation
Browse files Browse the repository at this point in the history
  • Loading branch information
b1rger committed May 7, 2024
1 parent ca5bf94 commit 752d201
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions apis_core/apis_relations/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down

0 comments on commit 752d201

Please sign in to comment.