Exemple #1
0
def factory(username="eric",
            email="[email protected]",
            password="abc123"):
    hashed_pw = auth_logic.hash_password(password)
    user = User(username=username, email=email, password=hashed_pw)
    user.save()
    return user
Exemple #2
0
def register_user(form):
    encoded_pw = form.password.data.encode('utf-8')
    hashed_password = auth_logic.hash_password(encoded_pw)
    user = User(username=form.username.data,
                email=form.email.data,
                password=hashed_password)
    user.save()
    return unicode(user.pk)