diff --git a/djangorestframework/resources.py b/djangorestframework/resources.py index 5e350268b..81c2fda79 100644 --- a/djangorestframework/resources.py +++ b/djangorestframework/resources.py @@ -309,14 +309,11 @@ class ModelResource(FormResource): return None # Instantiate the ModelForm as appropriate - if data is not None or files is not None: - if issubclass(form, forms.ModelForm) and hasattr(self.view, 'model_instance'): - # Bound to an existing model instance - return form(data, files, instance=self.view.model_instance) - else: - return form(data, files) + form_kwargs = {'data': data, 'files': files} + # Bound to an existing model instance + if issubclass(form, forms.ModelForm) and hasattr(self.view, 'model_instance'): form_kwargs['instance'] = self.view.model_instance - return form() + return form(**form_kwargs) @property def _model_fields_set(self):