From 39c0c07786c9fd74f280297cae383ac3ba675901 Mon Sep 17 00:00:00 2001 From: Carmen Wick Date: Mon, 4 Apr 2011 16:16:41 -0700 Subject: [PATCH] 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. --- djangorestframework/emitters.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/djangorestframework/emitters.py b/djangorestframework/emitters.py index 4cd462cb1..2769a4f55 100644 --- a/djangorestframework/emitters.py +++ b/djangorestframework/emitters.py @@ -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: