diff --git a/djangorestframework/resources.py b/djangorestframework/resources.py index 561289fc0..cc338cc05 100644 --- a/djangorestframework/resources.py +++ b/djangorestframework/resources.py @@ -309,11 +309,14 @@ class ModelResource(FormResource): return None # Instantiate the ModelForm as appropriate - form_kwargs = {'data': data, 'files': files} - # Bound to an existing model instance - if hasattr(self.view, 'model_instance'): form_kwargs['instance'] = self.view.model_instance + 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) - return form(**form_kwargs) + return form() def url(self, instance): """