mirror of
https://github.com/django/django.git
synced 2025-10-24 06:06:09 +00:00
Fixed #21967: Added check for object in ModelFormMixin.get_form_kwargs.
Thanks lagovas.lagovas at gmail.com for the report.
This commit is contained in:
@@ -122,7 +122,8 @@ class ModelFormMixin(FormMixin, SingleObjectMixin):
|
||||
Returns the keyword arguments for instantiating the form.
|
||||
"""
|
||||
kwargs = super(ModelFormMixin, self).get_form_kwargs()
|
||||
kwargs.update({'instance': self.object})
|
||||
if hasattr(self, 'object'):
|
||||
kwargs.update({'instance': self.object})
|
||||
return kwargs
|
||||
|
||||
def get_success_url(self):
|
||||
|
||||
Reference in New Issue
Block a user