示例#1
0
def add_slot_i(iid):
    t_from = request.args.get('t_from', -1)
    t_to = request.args.get('t_to', -1)
    if Interviewer.check_existence_by_id(iid):
        if is_slot_legal(t_from, t_to):
            t_from = int(t_from)
            t_to = int(t_to)
            Interviewer.add_slot_by_id(iid, t_from, t_to)
            slots = Interviewer.get_slots_by_id(iid)
            return api_encoder(slots)
        else:
            return bad_request('Slot is illegal')
    else:
        return bad_request('Interviewer not exists')