Пример #1
0
def check_password(username, password):
    pw_hash = redis.hget('user:passwords', slug(username))
    if pw_hash is None:
        return None
    if check_password_hash(pw_hash, password):
        return True
    return False
Пример #2
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
    }
Пример #3
0
def get_type_template(slug, key='details'):
    return redis.hget('t:%s' % key, slug) or '-'
Пример #4
0
 def get(id):
     return redis.hget(REDIS_SESSION, id)