Fixed Django 2.1 error due to missing use_required_attribute=False for empty forms
This attribute is supported as of Django 1.10, so adding it without conditional Django version checks. Fixes #360fix_request_path_info
parent
5f50aa1dca
commit
374afc3eac
|
|
@ -153,6 +153,7 @@ class BasePolymorphicModelFormSet(BaseModelFormSet):
|
||||||
# the minimum forms.
|
# the minimum forms.
|
||||||
if i >= self.initial_form_count() and i >= self.min_num:
|
if i >= self.initial_form_count() and i >= self.min_num:
|
||||||
defaults['empty_permitted'] = True
|
defaults['empty_permitted'] = True
|
||||||
|
defaults['use_required_attribute'] = False
|
||||||
defaults.update(kwargs)
|
defaults.update(kwargs)
|
||||||
|
|
||||||
# Need to find the model that will be displayed in this form.
|
# Need to find the model that will be displayed in this form.
|
||||||
|
|
@ -248,6 +249,7 @@ class BasePolymorphicModelFormSet(BaseModelFormSet):
|
||||||
auto_id=self.auto_id,
|
auto_id=self.auto_id,
|
||||||
prefix=self.add_prefix('__prefix__'),
|
prefix=self.add_prefix('__prefix__'),
|
||||||
empty_permitted=True,
|
empty_permitted=True,
|
||||||
|
use_required_attribute=False,
|
||||||
**kwargs
|
**kwargs
|
||||||
)
|
)
|
||||||
self.add_fields(form, None)
|
self.add_fields(form, None)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue