From ae03f9c527219bdb781d7f2e40314e5f3430856b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=80=C3=AE=C3=97=C3=9A=C3=95=C3=B1?= Date: Mon, 19 Sep 2022 15:45:53 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=961?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api/api_v1/endpoints/interview.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/api/api_v1/endpoints/interview.py b/api/api_v1/endpoints/interview.py index a32a9d0..f27d3c4 100644 --- a/api/api_v1/endpoints/interview.py +++ b/api/api_v1/endpoints/interview.py @@ -1203,7 +1203,7 @@ async def name( for i in res: if i.get('name') != 'root': data_dict = {} - data_dict['_id'] = i.get('_id') + data_dict['_id'] = str(i.get('_id')) data_dict['name'] = i.get('name') data_dict['user_id'] = i.get('user_id') data_dict['email'] = i.get('email') @@ -1928,6 +1928,8 @@ async def send_interviewee( res = await ckdb.execute(sql) job_id = res[0]['job_id'] user = await crud.jobs.find_job(db, job_id) + if not user: + return schemas.Msg(code=-9, msg='职位不存在', data='') user_list = [i['user_id'] for i in user['hr_name']] send = f"""【推荐通知】\n{current_user.name}给你推荐了一位面试者\n面试者姓名:{res[0]['name']}\n岗位:{res[0]['job_names']}""" send_dates(send, user_list)