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:
Agrendalath
2019-12-12 04:49:12 +01:00
parent c804bca577
commit c05f241eab

View File

@@ -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")