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)})