Ejemplo n.º 1
0
def register_account(form, _openid):
    """ create an account """
    user = User.objects.create_user(form.cleaned_data['username'], 
                            form.cleaned_data['email'])
    user.backend = "django.contrib.auth.backends.ModelBackend"
    oid_register.send(sender=user, openid=_openid)
    return user
Ejemplo n.º 2
0
def register_account(form, _openid):
    """ create an account """
    user = User.objects.create_user(form.cleaned_data['username'],
                                    form.cleaned_data['email'])
    user.backend = "django.contrib.auth.backends.ModelBackend"
    oid_register.send(sender=user, openid=_openid)
    return user
Ejemplo n.º 3
0
def register_account(form, _openid):
    """ create an account """
    user = User.objects.create_user(form.cleaned_data['username'], 
                            form.cleaned_data['email'])
    user.backend = "django.contrib.auth.backends.ModelBackend"
    #user.set_unusable_password()
    # lets allow a user to reset his/her password if necessary
    user.set_password(User.objects.make_random_password(length=20))
    oid_register.send(sender=user, openid=_openid)
    return user
Ejemplo n.º 4
0
def register_account(form, _openid):
    """This is a hook for creating an account called from django_authopenid"""

    user_ob = User.objects.create_user(form.cleaned_data['username'],
                            form.cleaned_data['email'])
    user_ob.save()
    profile = UserProfile(
        user=user_ob,
        location=form.cleaned_data['location'],
        url=form.cleaned_data['url'],
        about=form.cleaned_data['about'],
        restkey=hashlib.sha1("%s%s%s" % (str(random.random()), 'snippify.me',
                                         str(time.time()))).hexdigest(),
    )
    profile.save()
    user_ob.backend = "django.contrib.auth.backends.ModelBackend"
    oid_register.send(sender=user_ob, openid=_openid)
    return user_ob