Allow one letter extra fields
Some existing or custom extra fields may be actually shorter than 2 letters (e.g. [cities](https://en.wikipedia.org/wiki/List_of_short_place_names)). Therefore we can decrease the `min_length` of these fields to `1`.
This commit is contained in:
@@ -181,7 +181,6 @@ class AccountCreationForm(forms.Form):
|
||||
error_messages={"required": _("You must accept the terms of service.")}
|
||||
)
|
||||
|
||||
# TODO: These messages don't say anything about minimum length
|
||||
error_message_dict = {
|
||||
"level_of_education": _("A level of education is required"),
|
||||
"gender": _("Your gender is required"),
|
||||
@@ -202,7 +201,7 @@ class AccountCreationForm(forms.Form):
|
||||
)
|
||||
else:
|
||||
required = field_value == "required"
|
||||
min_length = 1 if field_name in ("gender", "level_of_education") else 2
|
||||
min_length = 1
|
||||
error_message = error_message_dict.get(
|
||||
field_name,
|
||||
_("You are missing one or more required fields")
|
||||
|
||||
Reference in New Issue
Block a user