user registration /accounts/register username creation

Create issue
Issue #1258 resolved
scrapper created an issue

At the moment the name of a user is created out of first_name and last_name and email.

Lets add the possibility to create a individual username.

Could we add: {{{ #!python username = forms.RegexField(regex=r'^\w+$', max_length=30, widget=forms.TextInput(attrs=attrs_dict), label=_(u'username'))


to /../satchmo_store/accounts/ class RegistrationForm.

and with a switch in such as:


we could activate the possibility to register with a random name rather than a first_name last_name email combination. i think this is more pretty and common than the actual way of creating a username.

other affected parts which need some changes would be:

{{{ #!python def save_contact(self, request): log.debug("Saving contact") data = self.cleaned_data password = data['password1'] email = data['email'] first_name = data['first_name'] last_name = data['last_name'] if settings.INDIVIDUAL_USERNAME: username = data['username'] else: username = generate_id(first_name, last_name, email) }}} in ../accounts/

affected Template: registration_form.html

if i am wrong, or if there is another solution to this one please correct me.

Thanks a lot scrapper

Comments (9)

  1. scrapper reporter

    Hello Chris,

    i have created a patch.txt. i hope its all right. Please check it and tell me what i should do better.

    what one has to do is add in

        'SHOP_BASE': '/online-shop',
        'MULTISHOP': False,
        'SSL': True,
    +   'NICKNAME' : True, # default = false. allow a random username instead of a username built out of first_name, last_name, email

    NICKNAME: True. => an extra username_field will appear at registration_form.html. if commented# or False username creation as usual.

  2. Chris Moffitt repo owner

    Ideally, I'd like to use for this instead of a SATCHMO_SETTING

    Other than that, the basic idea looks pretty good.

  3. scrapper reporter

    hello chris,

    i have changed it as you suggested to use instead of SATCHMO_SETTING. now the user is able to check a box in admin settings.

    please verify thank you scrapper

  4. Log in to comment