mirror of
https://github.com/encode/django-rest-framework.git
synced 2025-03-20 01:44:14 +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:
|
||||
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:
|
||||
|
|
Loading…
Reference in New Issue
Block a user