'We use the selected email here and reset the social logging list of
email addresses before they get created.
We send our welcome email via celery during complete_signup.
So, we need to manually commit the user to the db for it.'

def form_valid(self, form):

    selected_email = form.cleaned_data['email']
    if form.other_email_used:
        data = {'email': selected_email, 'verified': False, 'primary': True}
    else:
        data = self.email_addresses.get(selected_email, None)
    if data:
        primary_email_address = EmailAddress(email=data['email'], verified=data['verified'], primary=True)
        form.sociallogin.email_addresses = self.sociallogin.email_addresses = [primary_email_address]
        if data['verified']:
            get_adapter().stash_verified_email(self.request, data['email'])
    with transaction.atomic():
        form.save(self.request)
    return helpers.complete_social_signup(self.request, self.sociallogin)
