skoczen / django-longer-username

An app to easily provide a longer username field for django.
Other
63 stars 43 forks source link

Application Does Not Seem to work with django 1.4.1 #17

Closed daniyalzade closed 9 years ago

daniyalzade commented 11 years ago

It looks like the validators are not updated. Is that the case, or am I doing something wrong?

trevoriancox commented 10 years ago

The suggested change in urls.py doesn't fix the admin login validation for me (1.4.10), so I added this monkey patch in forms.py:

auth_forms.AuthenticationForm.base_fields['username'].max_length = MAX_USERNAME_LENGTH() auth_forms.AuthenticationForm.base_fields['username'].widget.attrs['maxlength'] = MAX_USERNAME_LENGTH() # html auth_forms.AuthenticationForm.base_fields['username'].validators[0].limit_value = MAX_USERNAME_LENGTH()

I'm sure there's a better way.

skoczen commented 9 years ago

Closing this up, since the supported solution is to use the more maintained fork https://github.com/madssj/django-longer-username-and-email, or Django 1.5+'s custom user models.

Thanks! -Steven