same logic, more pythonic

This commit is contained in:
Martin Hill 2015-11-14 23:04:32 -05:00
parent bac6f1fcf4
commit ff36cbe4ba

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') and field.to_fields else None
return getattr(field, 'to_fields', None) and field.to_fields[0]
def _get_forward_relationships(opts):