Beispiel #1
0
def root():
    user_cookie = request.cookies.get('santaselector')
    if not user_cookie:
        user_cookie = generate_cookie()
        response = make_response(render_template('index.html', users=persistence.get_users()))
        response.set_cookie('santaselector', value=bytes(user_cookie))
        return response
    else:
        return render_template('index.html', users=persistence.get_users())
Beispiel #2
0
def root():
    user_cookie = request.cookies.get('santaselector')
    if not user_cookie:
        user_cookie = generate_cookie()
        response = make_response(
            render_template('index.html', users=persistence.get_users()))
        response.set_cookie('santaselector', value=bytes(user_cookie))
        return response
    else:
        return render_template('index.html', users=persistence.get_users())
Beispiel #3
0
def del_user(id):
    persistence.remove_user(id)
    userList = persistence.get_users()
    update_matches(userList)
    return render_template('userlist.html', users=userList)
Beispiel #4
0
def post():
    user_dict = json.loads(request.data)
    persistence.add_user(user_dict)
    userList = persistence.get_users()
    update_matches(userList)
    return render_template('userlist.html', users=userList), 201
Beispiel #5
0
def del_user(id):
    persistence.remove_user(id)
    userList = persistence.get_users()
    update_matches(userList)
    return render_template('userlist.html', users=userList)
Beispiel #6
0
def post():
    user_dict = json.loads(request.data)
    persistence.add_user(user_dict)
    userList = persistence.get_users()
    update_matches(userList)
    return render_template('userlist.html', users=userList), 201