Bläddra i källkod

HUE-8020 [core] Increase username login input length (#1104)

The max length for a username on Django 1.11 is 150 (was increased from
30): https://docs.djangoproject.com/en/1.11/ref/contrib/auth/#django.contrib.auth.models.User.username

I've checked the size of the username field on `auth_user` and the field
is a `varchar(150)`, so it should be safe to increase.

Co-authored-by: Romain Rigaux <romain.rigaux@gmail.com>
gnieto 5 år sedan
förälder
incheckning
ea0b39982f
1 ändrade filer med 1 tillägg och 1 borttagningar
  1. 1 1
      desktop/core/src/desktop/auth/forms.py

+ 1 - 1
desktop/core/src/desktop/auth/forms.py

@@ -72,7 +72,7 @@ class AuthenticationForm(DjangoAuthenticationForm):
     'inactive': _t("Account deactivated. Please contact an administrator."),
   }
 
-  username = CharField(label=_t("Username"), widget=TextInput(attrs={'maxlength': 30, 'placeholder': _t("Username"), 'autocomplete': 'off', 'autofocus': 'autofocus'}))
+  username = CharField(label=_t("Username"), widget=TextInput(attrs={'maxlength': 150, 'placeholder': _t("Username"), 'autocomplete': 'off', 'autofocus': 'autofocus'}))
   password = CharField(label=_t("Password"), widget=PasswordInput(attrs={'placeholder': _t("Password"), 'autocomplete': 'off'}))
 
   def authenticate(self):