mirror of
https://github.com/encode/django-rest-framework.git
synced 2024-12-01 05:54:01 +03:00
update to pass data and files as kwargs
This commit is contained in:
parent
eef995a21c
commit
e97cafabb6
|
@ -212,7 +212,7 @@ class FormResource(Resource):
|
||||||
return None
|
return None
|
||||||
|
|
||||||
if data is not None or files is not None:
|
if data is not None or files is not None:
|
||||||
form_ = form(data, files)
|
form_ = form(data=data, files=files)
|
||||||
else:
|
else:
|
||||||
form_ = form()
|
form_ = form()
|
||||||
|
|
||||||
|
@ -338,9 +338,9 @@ class ModelResource(FormResource):
|
||||||
if data is not None or files is not None:
|
if data is not None or files is not None:
|
||||||
if issubclass(form, forms.ModelForm) and hasattr(self.view, 'model_instance'):
|
if issubclass(form, forms.ModelForm) and hasattr(self.view, 'model_instance'):
|
||||||
# Bound to an existing model instance
|
# Bound to an existing model instance
|
||||||
form_ = form(data, files, instance=self.view.model_instance)
|
form_ = form(data=data, files=files, instance=self.view.model_instance)
|
||||||
else:
|
else:
|
||||||
form_ = form(data, files)
|
form_ = form(data=data, files=files)
|
||||||
|
|
||||||
else:
|
else:
|
||||||
form_ = form()
|
form_ = form()
|
||||||
|
|
Loading…
Reference in New Issue
Block a user