From fb77c251c3a0a9c266b6926ea414d7cffcfbf477 Mon Sep 17 00:00:00 2001 From: nineven Date: Sat, 26 Feb 2022 19:18:57 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- fir_ser/api/views/login_wx.py | 4 ++-- fir_ser/api/views/order.py | 4 ++-- fir_ser/xsign/views/receiveudids.py | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/fir_ser/api/views/login_wx.py b/fir_ser/api/views/login_wx.py index 331aa78..a4fd10f 100644 --- a/fir_ser/api/views/login_wx.py +++ b/fir_ser/api/views/login_wx.py @@ -57,7 +57,7 @@ class WeChatBindView(APIView): return wx_qr_code_response(ret, code, qr_info, get_real_ip_address(request)) -def login_res(result, *args, **kwargs): +def expect_func(result, *args, **kwargs): return result and result.get('pk') @@ -68,7 +68,7 @@ class WeChatLoginCheckView(APIView): return Response(ret.dict) ticket = request.data.get("ticket") if ticket: - status, wx_ticket_data = get_pending_result(get_wx_ticket_login_info_cache, login_res, ticket=ticket, + status, wx_ticket_data = get_pending_result(get_wx_ticket_login_info_cache, expect_func, ticket=ticket, locker_key=ticket) if status: if wx_ticket_data.get('pk', -1) == -1: diff --git a/fir_ser/api/views/order.py b/fir_ser/api/views/order.py index e181098..b0c307f 100644 --- a/fir_ser/api/views/order.py +++ b/fir_ser/api/views/order.py @@ -123,7 +123,7 @@ def get_order_obj(user_obj, order_number): return Order.objects.filter(user_id=user_obj, order_number=order_number).first() -def except_result(result, *args, **kwargs): +def expect_func(result, *args, **kwargs): if result and result.status in [0, 4, 5, 6]: return True @@ -135,7 +135,7 @@ class OrderSyncView(APIView): res = BaseResponse() order_number = request.data.get("order_number", None) if order_number: - status, result = get_pending_result(get_order_obj, except_result, order_number=order_number, + status, result = get_pending_result(get_order_obj, expect_func, order_number=order_number, locker_key=order_number, user_obj=request.user) if not status and result: res.code = 1001 diff --git a/fir_ser/xsign/views/receiveudids.py b/fir_ser/xsign/views/receiveudids.py index e195635..6b7f8af 100644 --- a/fir_ser/xsign/views/receiveudids.py +++ b/fir_ser/xsign/views/receiveudids.py @@ -80,7 +80,7 @@ class IosUDIDView(APIView): "%s/%s?udid=%s%s" % (server_domain, short, format_udid_info.get("udid"), msg)) -def except_result(result, *args, **kwargs): +def expect_func(result, *args, **kwargs): app_info = kwargs.get('app_info') logger.info(f"app {app_info} sign task state {result.state} AA {result.successful()}") cache = TaskStateCache(app_info.pk, kwargs.get('task_id')) @@ -111,7 +111,7 @@ class TaskView(APIView): if task_id: app_info = Apps.objects.filter(short=short).first() if app_info: - status, result = get_pending_result(task_func, except_result, task_id=task_id, + status, result = get_pending_result(task_func, expect_func, task_id=task_id, locker_key=task_id, app_info=app_info) if status: if result.successful():