Commit 91e2ab0a authored by Bob Cribbs's avatar Bob Cribbs

Fix `ListField(EmbeddedDocumentField('Model'))` not converting `'Model'`

to `Model` and raising `TypeError: 'str' object is not callable`
parent 84f3321a
from mongoengine.base import get_document
from werkzeug.datastructures import FileStorage
from wtforms import fields
......@@ -26,6 +28,9 @@ class ModelFormField(InlineFormField):
super(ModelFormField, self).__init__(form_class, **kwargs)
self.model = model
if isinstance(self.model, str):
self.model = get_document(self.model)
self.view = view
self.form_opts = form_opts
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment