Skip to content

Commit

Permalink
skip RelationshipType for non-related models
Browse files Browse the repository at this point in the history
  • Loading branch information
sheppard committed Dec 30, 2015
1 parent c5bbd1f commit 8f7ff7e
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions rest/models.py
Expand Up @@ -91,6 +91,8 @@ def get_all_parents(self):

def get_relationshiptype_parents(self):
parents = set()
if not self.is_related:
return parents
for rtype in RelationshipType.objects.filter(to_type=self):
ctype = rtype.from_type
# This is a DjangoContentType, swap for our custom version
Expand Down

0 comments on commit 8f7ff7e

Please sign in to comment.