Use cleaned_content instead of raw_content when generating a form instance for the DocumentingTemplateEmitter. This allows the form to be prepopulated with the resource's existing values.

This commit is contained in:
Carmen Wick 2011-04-04 16:16:41 -07:00
parent 23d924eb9b
commit 39c0c07786

View File

@ -227,7 +227,7 @@ class DocumentingTemplateEmitter(BaseEmitter):
# Otherwise if we have a response that is valid against the form then use that
if not form_instance and resource.response.has_content_body:
try:
form_instance = resource.get_bound_form(resource.response.raw_content)
form_instance = resource.get_bound_form(resource.response.cleaned_content)
if form_instance and not form_instance.is_valid():
form_instance = None
except: