@app.route('/checks/id/<checkid>/next', methods=['GET', 'POST'])
@login_required
def check_next(checkid):
    """Reschedule a given check"""
    if request.method == 'GET':
        check = r.table("checks").get(checkid).run(rdb.conn)
        if check:
            check['id'] = str(check['id'])
            return jsonify({'check': check})
        else:
            abort(404)
    elif request.method == 'POST':
        if not request.json:
            abort(400)
        try:
            if not request.json.get('next'):
                abort(400)
            if request.json.get('next') == 'now':
                q = r.table("checks").get(checkid).update({"next": time() - 1}).run(rdb.conn)
            else:
                q = r.table("checks").get(checkid).update({"next": int(request.json["next"])}).run(rdb.conn)
            if q["replaced"] != 0:
                return jsonify({'success': True})
            else:
                abort(404)
        except Exception as err:
            logger.error(err)
            abort(400)
dataset/ETHPy150Open pandemicsyn/stalker/stalkerweb/stalkerweb/views.py/check_next/original