adamchainz / django-upgrade

Automatically upgrade your Django projects.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Replace `ModelMultipleChoiceField`'s `list` error message with `invalid_list`

UnknownPlatypus opened this issue · comments

Description

Since django 3.1, the forms.ModelMultipleChoiceField list error message key is deprecated in favor of invalid_list.

SImilarly to the EmailValidator(whitelist=...), I think this could be auto-fixed.

-forms.ModelMultipleChoiceField(error_messages={"list": "Enter multiple values."})
+forms.ModelMultipleChoiceField(error_messages={"invalid_list": "Enter multiple values."})

Would you be interested in a PR ?

Yeah sure!