Example #1
0
def register_user(key, username, password):
    if not password:
        return False
    if not check_invite(key):
        return False
    email = redis.hget('user:keys', key)
    username = slug(username)
    if redis.hexists('user:passwords', username):
        return False
    set_email(username, email)
    set_password(username, password)
    redis.hdel('user:keys', key)
    return {
        'username': username,
        'email': email
    }
Example #2
0
def user_exists(username):
    return redis.hexists('user:passwords', slug(username))