mirror of
https://github.com/encode/django-rest-framework.git
synced 2025-07-23 22:49:50 +03:00
actually look for the right attribute
This commit is contained in:
parent
19bcc3c865
commit
bd24d83333
|
@ -127,7 +127,7 @@ class BaseSerializer(Field):
|
||||||
if key not in ret:
|
if key not in ret:
|
||||||
ret[key] = val
|
ret[key] = val
|
||||||
try:
|
try:
|
||||||
if getattr(val.source, primary_key):
|
if getattr(val.source, 'primary_key'):
|
||||||
pk_field = key
|
pk_field = key
|
||||||
except AttributeError:
|
except AttributeError:
|
||||||
pass
|
pass
|
||||||
|
|
Loading…
Reference in New Issue
Block a user