Skip to content

Commit

Permalink
Merge pull request #30 from uncovertruth/fix/related_field_check
Browse files Browse the repository at this point in the history
Fix related field check bugs
  • Loading branch information
heavenshell authored Jun 3, 2017
2 parents 4e413b4 + 9e50519 commit 56fb565
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 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
2 changes: 1 addition & 1 deletion horizon/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,5 +87,5 @@ def get_or_create_index(model, horizontal_key):
},
)
if created:
logger.info("Assign new index to '%s': %s", model, metadata.index)
logger.info("Assign new index to '%s': %s", horizontal_group, metadata.index)
return metadata.index

0 comments on commit 56fb565

Please sign in to comment.