Fix AttributeError when creating EmbeddedDocument

When an EmbeddedDocument is initialized with positional arguments, the
document attempts to read _auto_id_field attribute which may not exist
and would throw an AttributeError exception and fail the initialization.

This change and the test is based on the discussion in issue #681 and
PR #777 with a number of community members.
This commit is contained in:
Shu Shen
2016-04-07 09:56:21 -07:00
parent ab10217c86
commit 3f30808104
4 changed files with 17 additions and 1 deletions

View File

@@ -237,3 +237,4 @@ that much better:
* Bryan Bennett (https://github.com/bbenne10)
* Gilb's Gilb's (https://github.com/gilbsgilbs)
* Joshua Nedrud (https://github.com/Neurostack)
* Shu Shen (https://github.com/shushen)