MongoEngine/flask-mongoengine — pull request #36 by IamFive (2013-03-07 04:10:58+00:00)
Title: when a subdoc of Mongoengine Document has no default setted

when a subdoc of Mongoengine Document has no default setted, but the form has data for this sub-doc, it will raise error.

testcase.
class Location(EmbeddedDocument):
address = StringField(max_length=128, required=True)
city = StringField(max_length=128)
state = StringField(max_length=128)
zip = StringField(max_length=16)
lat = StringField(max_length=32)
lon = StringField(max_length=32)

class School(Document):
name = StringField(max_length=128, required=True)
location = EmbeddedDocumentField(Location)

when form post 'location-address' : 'aaaa', the error raised.