mirror of
https://github.com/encode/django-rest-framework.git
synced 2025-07-23 06:29:58 +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:
|
||||
ret[key] = val
|
||||
try:
|
||||
if getattr(val.source, primary_key):
|
||||
if getattr(val.source, 'primary_key'):
|
||||
pk_field = key
|
||||
except AttributeError:
|
||||
pass
|
||||
|
|
Loading…
Reference in New Issue
Block a user