mirror of
https://github.com/encode/django-rest-framework.git
synced 2025-02-26 08:20:46 +03:00
Remove type error in Resource's .get_bound_form()
This commit is contained in:
parent
c42c72c8bf
commit
eb11dd5803
|
@ -311,7 +311,7 @@ class ModelResource(FormResource):
|
|||
# Instantiate the ModelForm as appropriate
|
||||
form_kwargs = {'data': data, 'files': files}
|
||||
# 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 issubclass(form, forms.ModelForm) and hasattr(self.view, 'model_instance'): form_kwargs['instance'] = self.view.model_instance
|
||||
|
||||
return form(**form_kwargs)
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user