Skip to content

Commit

Permalink
Fix rendering HTML form when API error raised. Closes #2103.
Browse files Browse the repository at this point in the history
  • Loading branch information
tomchristie committed Nov 20, 2014
1 parent d037c53 commit 5b671cb
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion rest_framework/renderers.py
Original file line number Diff line number Diff line change
Expand Up @@ -525,7 +525,10 @@ def get_rendered_html_form(self, data, view, method, request):
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:
Expand Down

0 comments on commit 5b671cb

Please sign in to comment.