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': if result.get('status') and result['status'] == 'UPLOADED':
# 图片上传成功,处理业务逻辑 # 图片上传成功,处理业务逻辑
try: try:
rpc.diet.add(session['user_id'], rpc.diet.add(**{
category=category, 'user_id': session['user_id'],
diet_image_id=result['_id']) 'category': category,
'diet_image_id': result['_id'],
})
except Exception as e: except Exception as e:
raise DietCreationError(extra_data={'error_docs': str(e)}) raise DietCreationError(extra_data={'error_docs': str(e)})