You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
FuzzyDateFormField.__init__ currently pops max_length from kwargs because it may be set as a default by CharField.formfield, but is not valid for forms.MultiValueField.
Under certain circumstances, CharField.formfield also adds a default value for empty_value of None. This is similarly not valid for forms.MultiValueField and so should also probably be popped.
For reference, this is CharField.formfield as it stands in Django 5.1.2:
defformfield(self, **kwargs):
# Passing max_length to forms.CharField means that the value's length# will be validated twice. This is considered acceptable since we want# the value in the form field (to pass into widget for example).defaults= {"max_length": self.max_length}
# TODO: Handle multiple backends with different feature flags.ifself.nullandnotconnection.features.interprets_empty_strings_as_nulls:
defaults["empty_value"] =Nonedefaults.update(kwargs)
returnsuper().formfield(**defaults)
I'd be happy to submit a PR with a fix if you'd like.
The text was updated successfully, but these errors were encountered:
FuzzyDateFormField.__init__
currently popsmax_length
fromkwargs
because it may be set as a default byCharField.formfield
, but is not valid forforms.MultiValueField
.Under certain circumstances,
CharField.formfield
also adds a default value forempty_value
ofNone
. This is similarly not valid forforms.MultiValueField
and so should also probably be popped.For reference, this is
CharField.formfield
as it stands in Django 5.1.2:I'd be happy to submit a PR with a fix if you'd like.
The text was updated successfully, but these errors were encountered: