From d048d32876e4a2f4acb6848b809097b9b9d48e50 Mon Sep 17 00:00:00 2001 From: Tom Christie Date: Wed, 5 Nov 2014 13:40:21 +0000 Subject: [PATCH] Minor cleanup --- rest_framework/serializers.py | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/rest_framework/serializers.py b/rest_framework/serializers.py index f00b685f4..9e5d0cabe 100644 --- a/rest_framework/serializers.py +++ b/rest_framework/serializers.py @@ -306,11 +306,7 @@ class Serializer(BaseSerializer): def get_initial(self): if self._initial_data is not None: - return ReturnDict([ - (field_name, field.get_value(self._initial_data)) - for field_name, field in self.fields.items() - if field.get_value(self._initial_data) is not empty - ], serializer=self) + return self.to_representation(self._initial_data) return ReturnDict([ (field.field_name, field.get_initial())