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
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 }
def get_type_template(slug, key='details'): return redis.hget('t:%s' % key, slug) or '-'
def get(id): return redis.hget(REDIS_SESSION, id)