mirror of
https://github.com/encode/django-rest-framework.git
synced 2025-03-27 05:14:25 +03:00
Fix rendering HTML form when API error raised. Closes #2103.
This commit is contained in:
parent
d037c53b57
commit
5b671cb515
|
@ -525,7 +525,10 @@ class BrowsableAPIRenderer(BaseRenderer):
|
||||||
else:
|
else:
|
||||||
instance = None
|
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:
|
try:
|
||||||
data = request.data
|
data = request.data
|
||||||
except ParseError:
|
except ParseError:
|
||||||
|
|
Loading…
Reference in New Issue
Block a user