mirror of
https://github.com/encode/django-rest-framework.git
synced 2025-09-16 09:12:29 +03:00
Revert "Revert Revert "Restore ModelForm instance check on Resource\'s get_bound_form\(\)""
This reverts commit 0479951523
.
This commit is contained in:
parent
2cf7cfe286
commit
7679f3791c
|
@ -311,7 +311,7 @@ class ModelResource(FormResource):
|
||||||
# Instantiate the ModelForm as appropriate
|
# Instantiate the ModelForm as appropriate
|
||||||
form_kwargs = {'data': data, 'files': files}
|
form_kwargs = {'data': data, 'files': files}
|
||||||
# Bound to an existing model instance
|
# Bound to an existing model instance
|
||||||
if issubclass(form, forms.ModelForm) and if hasattr(self.view, 'model_instance'): form_kwargs['instance'] = self.view.model_instance
|
if hasattr(self.view, 'model_instance'): form_kwargs['instance'] = self.view.model_instance
|
||||||
|
|
||||||
return form(**form_kwargs)
|
return form(**form_kwargs)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user