修复异常,优化代码

dependabot/npm_and_yarn/fir_admin/decode-uri-component-0.2.2
isummer 2 years ago
parent dc7b491534
commit 289737ed00
  1. 6
      fir_ser/xsign/utils/modelutils.py
  2. 9
      fir_ser/xsign/utils/supersignutils.py

@ -70,9 +70,9 @@ def check_super_sign_permission(user_obj):
return True return True
def check_ipa_is_latest_sign(app_obj, developer_obj=None): def check_ipa_is_latest_sign(app_obj, developer_obj=None, app_udid_obj=None):
if AppUDID.objects.filter(app_id=app_obj, udid__developerid=developer_obj, if not app_udid_obj and AppUDID.objects.filter(app_id=app_obj, udid__developerid=developer_obj,
sign_status__lt=SignStatus.SIGNATURE_PACKAGE_COMPLETE).first(): sign_status__lt=SignStatus.SIGNATURE_PACKAGE_COMPLETE).first():
return return
release_obj = AppReleaseInfo.objects.filter(app_id=app_obj, is_master=True).first() release_obj = AppReleaseInfo.objects.filter(app_id=app_obj, is_master=True).first()
all_app_to_dev = APPToDeveloper.objects.filter(app_id=app_obj) all_app_to_dev = APPToDeveloper.objects.filter(app_id=app_obj)

@ -472,7 +472,7 @@ def check_sign_is_exists(user_obj, app_obj, udid, developer_obj, sign=True):
app_udid_obj = AppUDID.objects.filter(app_id=app_obj, udid__udid=udid, udid__developerid=developer_obj).first() app_udid_obj = AppUDID.objects.filter(app_id=app_obj, udid__udid=udid, udid__developerid=developer_obj).first()
if app_udid_obj and app_udid_obj.sign_status >= SignStatus.PROFILE_DOWNLOAD_COMPLETE: if app_udid_obj and app_udid_obj.sign_status >= SignStatus.PROFILE_DOWNLOAD_COMPLETE:
if app_udid_obj.sign_status == SignStatus.SIGNATURE_PACKAGE_COMPLETE: if app_udid_obj.sign_status == SignStatus.SIGNATURE_PACKAGE_COMPLETE:
if check_ipa_is_latest_sign(app_obj, developer_obj): if check_ipa_is_latest_sign(app_obj, developer_obj, app_udid_obj):
d_result['msg'] = f'udid {udid} exists app_id {app_obj}' d_result['msg'] = f'udid {udid} exists app_id {app_obj}'
logger.warning(d_result) logger.warning(d_result)
return True, d_result return True, d_result
@ -624,6 +624,13 @@ class IosUtils(object):
udid=udid_obj, udid=udid_obj,
sign_status=SignStatus.PROFILE_DOWNLOAD_COMPLETE).update( sign_status=SignStatus.PROFILE_DOWNLOAD_COMPLETE).update(
sign_status=SignStatus.SIGNATURE_PACKAGE_COMPLETE) sign_status=SignStatus.SIGNATURE_PACKAGE_COMPLETE)
base_app_udid = AppUDID.objects.filter(app_id=app_obj, udid__developerid_id=developer_obj_id)
if base_app_udid.filter(sign_status__lt=SignStatus.SIGNATURE_PACKAGE_COMPLETE).count():
c_time = base_app_udid.order_by('-created_time').first()
u_time = base_app_udid.order_by('-updated_time').first()
if u_time.updated_time > c_time.created_time:
base_app_udid.update(sign_status=SignStatus.SIGNATURE_PACKAGE_COMPLETE)
del_cache_response_by_short(app_obj.app_id) del_cache_response_by_short(app_obj.app_id)
MagicCacheData.invalid_cache(app_obj.app_id) MagicCacheData.invalid_cache(app_obj.app_id)
return True return True

Loading…
Cancel
Save