From b6f5210fe746d08d280e4696fe2cb50cb6a5a046 Mon Sep 17 00:00:00 2001 From: youngS Date: Tue, 9 Mar 2021 17:07:12 +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/utils/app/supersignutils.py | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/fir_ser/api/utils/app/supersignutils.py b/fir_ser/api/utils/app/supersignutils.py index 347cdc7..ecd1d74 100644 --- a/fir_ser/api/utils/app/supersignutils.py +++ b/fir_ser/api/utils/app/supersignutils.py @@ -299,22 +299,34 @@ class IosUtils(object): def exec_download_profile(app_obj, developer_obj, udid_info, sign_try_attempts=3): result = {} developer_app_id = None + add_did_flag = False auth = get_auth_form_developer(developer_obj) while sign_try_attempts > 0: logger.info("exec_download_profile appid:%s developer:%s sign_try_attempts:%s" % ( app_obj, developer_obj, sign_try_attempts)) device_id_list = DeveloperDevicesID.objects.filter(app_id=app_obj, developerid=developer_obj).values_list('did') + device_id_lists = [did[0] for did in device_id_list] developer_app_id = None developer_appid_obj = DeveloperAppID.objects.filter(developerid=developer_obj, app_id=app_obj).first() if developer_appid_obj: developer_app_id = developer_appid_obj.aid + if udid_info: + sync_device_obj = UDIDsyncDeveloper.objects.filter(udid=udid_info.get('udid'), + developerid=developer_obj).first() + if sync_device_obj: + device_id_lists.append(sync_device_obj.serial) + udid_info = None + add_did_flag = True + logger.info( + "app %s device %s already in developer %s" % (app_obj, sync_device_obj.serial, developer_obj)) status, result = get_api_obj(auth).get_profile(app_obj, udid_info, get_profile_full_path(developer_obj, app_obj), - auth, developer_app_id, [did[0] for did in device_id_list]) - + auth, developer_app_id, device_id_lists) + if add_did_flag: + result['did'] = sync_device_obj.serial if not status: sign_try_attempts -= 1 logger.warning("app %s developer %s sign failed %s .try again " % (app_obj, developer_obj, result))