Example #1
0
def create_user(registration_form):
    user = get_user(username=registration_form.username.data)
    if not user and 'password' in registration_form:
        user = create_basic_user(registration_form)
        user.pw_hash = gen_password_hash(registration_form.password.data)
        user.save()
    return user
Example #2
0
def create_user(registration_form):
    user = get_user(username=registration_form.username.data)
    if not user and 'password' in registration_form:
        user = create_basic_user(registration_form)
        user.pw_hash = gen_password_hash(
            registration_form.password.data)
        user.save()
    return user
Example #3
0
def create_user(register_form):
    if 'openid' in register_form:
        username = register_form.username.data
        user = User.query.filter(
            or_(
                LocalUser.username == username,
                LocalUser.email == username,
            )).first()

        if not user:
            user = create_basic_user(register_form)

        new_entry = OpenIDUserURL()
        new_entry.openid_url = register_form.openid.data
        new_entry.user_id = user.id
        new_entry.save()

        return user
def create_user(register_form):
    if 'persona_email' in register_form:
        username = register_form.username.data
        user = User.query.filter(
            or_(
                User.username == username,
                User.email == username,
            )).first()

        if not user:
            user = create_basic_user(register_form)

        new_entry = PersonaUserEmails()
        new_entry.persona_email = register_form.persona_email.data
        new_entry.user_id = user.id
        new_entry.save()

        return user
Example #5
0
def create_user(register_form):
    if 'persona_email' in register_form:
        username = register_form.username.data
        user = User.query.filter(
            or_(
                User.username == username,
                User.email == username,
            )).first()

        if not user:
            user = create_basic_user(register_form)

        new_entry = PersonaUserEmails()
        new_entry.persona_email = register_form.persona_email.data
        new_entry.user_id = user.id
        new_entry.save()

        return user
Example #6
0
def create_user(register_form):
    if 'username' in register_form and 'password' not in register_form:
        return create_basic_user(register_form)
Example #7
0
def create_user(register_form):
    if 'username' in register_form and 'password' not in register_form:
        return create_basic_user(register_form)