Fix rendering HTML form when API error raised. Closes #2103.

This commit is contained in:
Tom Christie 2014-11-20 16:14:51 +00:00
parent d037c53b57
commit 5b671cb515

View File

@ -525,7 +525,10 @@ class BrowsableAPIRenderer(BaseRenderer):
else:
instance = None
if request.method == method:
# If this is valid serializer data, and the form is for the same
# HTTP method as was used in the request then use the existing
# serializer instance, rather than dynamically creating a new one.
if request.method == method and serializer is not None:
try:
data = request.data
except ParseError: