示例#1
0
def get_matching_for_candidate(cid):
    iids_raw = request.args.get('iids', [])
    iids = api_decoder(iids_raw)
    if Candidate.check_existence_by_id(cid):
        if type(iids) is list and len(iids) > 0:
            if Interviewer.check_all_existence_by_id(iids):
                print(cid, iids)
                ms = Candidate.get_matching_by_id(cid, iids)
                print(ms)
                return api_encoder(ms)
    else:
        return bad_request('Candidate not exists')

    return bad_request('Iids is illegal')