From 73f6470559d532b111b4f6f3069a3efe40a9662f Mon Sep 17 00:00:00 2001 From: BryantHe Date: Fri, 15 Sep 2023 18:23:36 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E9=A3=9F=E7=89=A9?= =?UTF-8?q?=E5=9B=BE=E7=89=87=E4=B8=8A=E4=BC=A0=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/api/v1/api.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/app/api/v1/api.py b/app/api/v1/api.py index b1db89c..c3ea9ac 100644 --- a/app/api/v1/api.py +++ b/app/api/v1/api.py @@ -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)})