matthiask / plata

Plata - the lean and mean Django-based Shop
https://plata-django-shop.readthedocs.io/
BSD 3-Clause "New" or "Revised" License
197 stars 63 forks source link

By default, email addresses with more than 30 characters don't work. #66

Open sbaechler opened 10 years ago

sbaechler commented 10 years ago

Plata uses email for login:

forms.py, line 67

if getattr(User, 'USERNAME_FIELD', 'username') == 'username':
    params['username'] = email[:30]  # FIXME
user = User.objects.create_user(**params)

the email address can be up to 100 characters, but the authentication form only allows for 30 characters because it references the username field:

def get_authentication_form(self, **kwargs):
    return AuthenticationForm(**kwargs)

There should be a AuthenticationForm by default which has a max_length of 100 characters if this way of authenticating is used.