Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
check if field.to_fields is None
  • Loading branch information
Martin Hill committed Nov 14, 2015
commit bac6f1fcf41d9c01177f5bbd031618ecd41e57f2
2 changes: 1 addition & 1 deletion rest_framework/utils/model_meta.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ def _get_fields(opts):


def _get_to_field(field):
return field.to_fields[0] if hasattr(field, 'to_fields') else None
return field.to_fields[0] if hasattr(field, 'to_fields') and field.to_fields else None


def _get_forward_relationships(opts):
Expand Down