Пример #1
0
def happy(user_id):
    pair_id = request.form['pair_shown_id']
    pair_matched = get_pair_from_pair_id(pair_id)
    user_id = request.form['user_id']
    user = get_user_from_user_id(user_id)
    user.make_pair_match(pair_matched)
    return render_template("happy.html", user=user,
                           pair_matched=pair_matched)
Пример #2
0
def sad(user_id):
    pair_id = request.form['pair_shown_id']
    pair_shown = get_pair_from_pair_id(pair_id)
    user_id = request.form['user_id']
    user = get_user_from_user_id(user_id)
    pair_shown.decline_this_pair(user_id)
    log.debug("Pair: {} declined by: {}".format(pair_shown, user))
    return render_template("sad.html", user=user,
                           pair_shown=pair_shown)