Skip to content

Commit

Permalink
Return None when related field.
Browse files Browse the repository at this point in the history
  • Loading branch information
Surgo committed Jun 3, 2017
1 parent 4e413b4 commit b4edf66
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions horizon/routers.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,7 @@ def _get_horizontal_index(self, model, hints):
instance = hints.get('instance', None)
if instance and isinstance(instance, model):
return instance._horizontal_database_index
if instance:
# From foreign field
horizontal_key = instance.pk
return None

if not horizontal_key:
raise IntegrityError("Missing 'horizontal_key'")
Expand Down

0 comments on commit b4edf66

Please sign in to comment.