示例#1
0
def clear_board(request, lease_code, row):
    response_data = dict()
    if has_current_lease(lease_code) == False:
        response_data['result'] = "failure"
    else:
        peggy_tasks.clear_board(row)
        response_data['result'] = "success"

    return HttpResponse(json.dumps(response_data), mimetype="application/json")
示例#2
0
def clear_board(request, lease_code, row=None):
    response_data = dict()
    if get_current_lease(lease_code) == None:
        response_data['result'] = "failure"
        response_data['reason_code'] = "bad_lease_code"
    else:
        peggy_tasks.clear_board(row)
        response_data['result'] = "success"

    return HttpResponse(json.dumps(response_data), mimetype="application/json")
示例#3
0
def clear_board(request, lease_code, row=None):
    response_data = dict()
    board_lease = get_current_lease(lease_code)
    if board_lease == None:
        generate_error(response_data, "bad_lease_code")
        add_lease_expiration(response_data, board_lease)
    else:
        peggy_tasks.clear_board(row)
        response_data['result'] = "success"
        add_lease_expiration(response_data, board_lease)

    return HttpResponse(json.dumps(response_data), mimetype="application/json")
示例#4
0
def clear_board(request, lease_code, row=None):
    response_data = dict()
    board_lease = get_current_lease(lease_code)
    if board_lease == None:
        generate_error(response_data, "bad_lease_code")
        add_lease_expiration(response_data, board_lease)
    else:
        peggy_tasks.clear_board(row)
        response_data["result"] = "success"
        add_lease_expiration(response_data, board_lease)

    return HttpResponse(json.dumps(response_data), mimetype="application/json")