fix: 修复食物图片上传接口
continuous-integration/drone/push Build is passing Details

This commit is contained in:
BryantHe 2023-09-15 18:23:36 +08:00
parent 0353bbe7b4
commit 73f6470559
1 changed files with 5 additions and 3 deletions

View File

@ -69,9 +69,11 @@ def upload_diet_image(files_data):
if result.get('status') and result['status'] == 'UPLOADED':
# 图片上传成功,处理业务逻辑
try:
rpc.diet.add(session['user_id'],
category=category,
diet_image_id=result['_id'])
rpc.diet.add(**{
'user_id': session['user_id'],
'category': category,
'diet_image_id': result['_id'],
})
except Exception as e:
raise DietCreationError(extra_data={'error_docs': str(e)})