check if field.to_fields is None

This commit is contained in:
Martin Hill 2015-11-14 18:26:29 -05:00
parent e475464945
commit bac6f1fcf4

View File

@ -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):