mirror of
https://github.com/encode/django-rest-framework.git
synced 2024-11-23 10:03:57 +03:00
Don't fill in the form after a DELETE.
This commit is contained in:
parent
55f7dd9bce
commit
59a0bc55af
|
@ -255,7 +255,7 @@ class DocumentingTemplateRenderer(BaseRenderer):
|
||||||
for k, v in serializer.fields.items():
|
for k, v in serializer.fields.items():
|
||||||
fields[k] = field_mapping[v.__class__.__name__]()
|
fields[k] = field_mapping[v.__class__.__name__]()
|
||||||
OnTheFlyForm = type("OnTheFlyForm", (forms.Form,), fields)
|
OnTheFlyForm = type("OnTheFlyForm", (forms.Form,), fields)
|
||||||
if object:
|
if object and not self.view.request.method == 'DELETE': # Don't fill in the form when the object is deleted
|
||||||
data = serializer.data
|
data = serializer.data
|
||||||
form_instance = OnTheFlyForm(data)
|
form_instance = OnTheFlyForm(data)
|
||||||
return form_instance
|
return form_instance
|
||||||
|
|
Loading…
Reference in New Issue
Block a user