mirror of
https://github.com/encode/django-rest-framework.git
synced 2024-11-23 10:03:57 +03:00
Merge pull request #3635 from martinhill/issue_3634
Relation fields no to_fields attribute attribute break serializer
This commit is contained in:
commit
316c374b02
|
@ -92,7 +92,7 @@ def _get_fields(opts):
|
||||||
|
|
||||||
|
|
||||||
def _get_to_field(field):
|
def _get_to_field(field):
|
||||||
return field.to_fields[0] if field.to_fields else None
|
return getattr(field, 'to_fields', None) and field.to_fields[0]
|
||||||
|
|
||||||
|
|
||||||
def _get_forward_relationships(opts):
|
def _get_forward_relationships(opts):
|
||||||
|
|
Loading…
Reference in New Issue
Block a user