Fix AttributeError caused by accessing a non-existing default_keys attribute.

This commit is contained in:
Marko Tibold 2012-12-07 00:08:27 +01:00
parent c65f22e0e4
commit 919aff329e

View File

@ -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)