mirror of
https://github.com/encode/django-rest-framework.git
synced 2025-02-03 13:14:30 +03:00
check if field.to_fields is None
This commit is contained in:
parent
e475464945
commit
bac6f1fcf4
|
@ -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):
|
||||
|
|
Loading…
Reference in New Issue
Block a user