代码bug修复

qrnn
youngS 3 years ago
parent fce8a09d5e
commit 8a59b8d329
  1. 2
      fir_ser/api/utils/app/iossignapi.py
  2. 4
      fir_ser/api/utils/app/supersignutils.py
  3. 6
      fir_ser/api/utils/modelutils.py
  4. 7
      fir_ser/api/utils/storage/caches.py
  5. 2
      fir_ser/fir_ser/settings.py

@ -209,7 +209,7 @@ class AppDeveloperApiV2(object):
certificates = apple_obj.get_all_certificates()
result['data'] = certificates
logger.info(f"ios developer active result:{certificates}")
if len(certificates) > 0:
if len(certificates) >= 0:
return True, result
except Exception as e:
logger.error(f"ios developer active Failed Exception:{e}")

@ -251,13 +251,13 @@ def get_developer_user_by_app_udid(user_objs, udid, app_obj):
# 根据udid和应用查找该用户开发者账户【主要可能是开发者未激活】
developer_obj = AppIOSDeveloperInfo.objects.filter(
pk__in=developer_udid_obj_list.filter(udid=udid, developerid__apptodeveloper__app_id=app_obj)).first()
pk__in=developer_udid_obj_list.filter(udid=udid, developerid__apptodeveloper__app_id=app_obj)).last()
if developer_obj:
logger.info(f'udid:{udid} app_obj:{app_obj} return')
return developer_obj, True
# 根据udid查找开发者账户
developer_obj = AppIOSDeveloperInfo.objects.filter(pk__in=developer_udid_obj_list.filter(udid=udid)).first()
developer_obj = AppIOSDeveloperInfo.objects.filter(pk__in=developer_udid_obj_list.filter(udid=udid)).last()
if developer_obj:
logger.info(f'udid:{udid} only and return')
return developer_obj, True

@ -158,14 +158,16 @@ def get_developer_can_used_from_public_sign(user_obj):
o_number_info = IosDeveloperPublicPoolBill.objects.filter(to_user_id__isnull=False, user_id=user_obj).values(
'number').aggregate(number=Sum('number'))
o_number = o_number_info.get("number", 0)
if o_number is None:
o_number = 0
u_number_info = IosDeveloperPublicPoolBill.objects.filter(
user_id_id__in=IosDeveloperPublicPoolBill.objects.filter(user_id=user_obj).values('to_user_id_id')).values(
'number',
'udid_sync_info_id').annotate(
counts=Count('udid_sync_info_id')).aggregate(number=Sum('number'))
u_number = u_number_info.get("number", 0)
if u_number is None:
u_number = 0
return o_number - u_number

@ -155,6 +155,12 @@ def del_short_cache(short):
cache.delete(app_download_key)
def del_make_token_key_cache(release_id):
key = "_".join(['', CACHE_KEY_TEMPLATE.get("make_token_key"), f"{release_id}*"])
for make_token_key in cache.iter_keys(key):
cache.delete(make_token_key)
def del_cache_response_by_short_util(short, app_id, udid):
logger.info(f"del_cache_response_by_short short:{short} app_id:{app_id} udid:{udid}")
del_short_cache(short)
@ -170,6 +176,7 @@ def del_cache_response_by_short_util(short, app_id, udid):
cache.delete("_".join([key, download_val, master_release_dict.get('release_id'), udid]))
cache.delete(
"_".join([key, CACHE_KEY_TEMPLATE.get("make_token_key"), master_release_dict.get('release_id'), udid]))
del_make_token_key_cache(master_release_dict.get('release_id'))
def del_cache_by_delete_app(app_id):

@ -179,6 +179,8 @@ REST_FRAMEWORK_EXTENSIONS = {
# 缓存存储
'DEFAULT_USE_CACHE': 'default',
}
# 取消自动加斜杠
APPEND_SLASH = False
# geetest 配置信息
GEETEST_ID = BASECONF.GEETEST_ID

Loading…
Cancel
Save