From c05f241eabeb4ac2f311c648b8d90780cc38533a Mon Sep 17 00:00:00 2001 From: Agrendalath Date: Thu, 12 Dec 2019 04:49:12 +0100 Subject: [PATCH] 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`. --- openedx/core/djangoapps/user_authn/views/registration_form.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/openedx/core/djangoapps/user_authn/views/registration_form.py b/openedx/core/djangoapps/user_authn/views/registration_form.py index 8d2bc5805a..6337d44625 100644 --- a/openedx/core/djangoapps/user_authn/views/registration_form.py +++ b/openedx/core/djangoapps/user_authn/views/registration_form.py @@ -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")