diff options
| author | Philip Douglas | 2013-09-13 10:46:24 +0100 |
|---|---|---|
| committer | Philip Douglas | 2013-09-13 10:46:24 +0100 |
| commit | 272a6abf91c51b44781d27af5352c7e36c8fa91c (patch) | |
| tree | cf092dd500dc9c888fe3a42a743498fd610fa339 | |
| parent | 6e4bdb55969171c87296aba9711dbc77f8a1e366 (diff) | |
| download | django-rest-framework-272a6abf91c51b44781d27af5352c7e36c8fa91c.tar.bz2 | |
Try a more localised fix to the data=None problem
| -rw-r--r-- | rest_framework/fields.py | 1 | ||||
| -rw-r--r-- | rest_framework/serializers.py | 2 |
2 files changed, 2 insertions, 1 deletions
diff --git a/rest_framework/fields.py b/rest_framework/fields.py index 210c2537..0c3817b5 100644 --- a/rest_framework/fields.py +++ b/rest_framework/fields.py @@ -306,6 +306,7 @@ class WritableField(Field): return try: + data = data or {} if self.use_files: files = files or {} try: diff --git a/rest_framework/serializers.py b/rest_framework/serializers.py index 778e72d1..a63c7f6c 100644 --- a/rest_framework/serializers.py +++ b/rest_framework/serializers.py @@ -156,7 +156,7 @@ class BaseSerializer(WritableField): self.context = context or {} - self.init_data = data or {} + self.init_data = data self.init_files = files self.object = instance self.fields = self.get_fields() |
