Fix handling invalid dict field value (#485)

This commit is contained in:
Ross Lawley 2013-11-29 10:33:36 +00:00
parent 3a3b96e0be
commit 6465726008
2 changed files with 2 additions and 1 deletions

View File

@ -4,6 +4,7 @@ Changelog
Changes in 0.8.5
================
- Fix testing invalid dict field value (#485)
- Added app_label to MongoUser (#484)
- Use defaults when host and port are passed as None (#483)
- Fixed distinct casting issue with ListField of EmbeddedDocuments (#470)

View File

@ -203,7 +203,7 @@ class ComplexBaseField(BaseField):
_dereference = _import_class("DeReference")()
self._auto_dereference = instance._fields[self.name]._auto_dereference
if instance._initialised and dereference:
if instance._initialised and dereference and instance._data.get(self.name):
instance._data[self.name] = _dereference(
instance._data.get(self.name), max_depth=1, instance=instance,
name=self.name