Commit 5b671cb5 by Tom Christie

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

parent d037c53b
......@@ -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:
......
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