mirror of
https://github.com/encode/django-rest-framework.git
synced 2025-01-24 00:04:16 +03:00
Fix AttributeError caused by accessing a non-existing default_keys attribute.
This commit is contained in:
parent
c65f22e0e4
commit
919aff329e
|
@ -123,7 +123,7 @@ class BaseSerializer(Field):
|
||||||
Returns the fieldnames that should not be validated.
|
Returns the fieldnames that should not be validated.
|
||||||
"""
|
"""
|
||||||
excluded_fields = list(self.opts.exclude)
|
excluded_fields = list(self.opts.exclude)
|
||||||
for field in self.fields.keys() + self.default_fields.keys():
|
for field in self.fields.keys() + self.get_default_fields().keys():
|
||||||
if self.opts.fields:
|
if self.opts.fields:
|
||||||
if field not in self.opts.fields + self.opts.exclude:
|
if field not in self.opts.fields + self.opts.exclude:
|
||||||
excluded_fields.append(field)
|
excluded_fields.append(field)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user