From 919aff329ee1bd214831095e4d96af71795ed572 Mon Sep 17 00:00:00 2001 From: Marko Tibold Date: Fri, 7 Dec 2012 00:08:27 +0100 Subject: [PATCH] Fix AttributeError caused by accessing a non-existing default_keys attribute. --- rest_framework/serializers.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rest_framework/serializers.py b/rest_framework/serializers.py index 984f3ac57..43bfda83b 100644 --- a/rest_framework/serializers.py +++ b/rest_framework/serializers.py @@ -123,7 +123,7 @@ class BaseSerializer(Field): Returns the fieldnames that should not be validated. """ 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 field not in self.opts.fields + self.opts.exclude: excluded_fields.append(field)