From 0cc5084390f1c9bee67d664e1dde71db8f276bdc Mon Sep 17 00:00:00 2001 From: isummer Date: Sun, 21 Aug 2022 22:38:25 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=8E=88=E6=9D=83=E7=BB=91?= =?UTF-8?q?=E5=AE=9A=E8=AE=BE=E5=A4=87=E6=B7=BB=E5=8A=A0=E9=87=8D=E5=A4=8D?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- fir_ser/api/views/apps.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/fir_ser/api/views/apps.py b/fir_ser/api/views/apps.py index e4e6621..1258eac 100644 --- a/fir_ser/api/views/apps.py +++ b/fir_ser/api/views/apps.py @@ -397,7 +397,7 @@ class AppDownloadTokenView(APIView): if udid_list_str and len(udid_list_str) > 10: udid_list = udid_list_str.replace(' ', ' ').replace('\n', ' ').replace(',', ' ').replace('\r\n', ' ').split() - udid_list = list(filter(lambda x: len(x) > 10, udid_list)) + udid_list = set(filter(lambda x: len(x) > 10, udid_list)) token = '' app_obj = Apps.objects.filter(user_id=request.user, app_id=app_id).first() @@ -416,6 +416,9 @@ class AppDownloadTokenView(APIView): token_number = 20 if udid_list: + bind_udid_list = AppDownloadToken.objects.filter(app_id=app_obj, bind_udid__isnull=False).values_list( + 'bind_udid') + udid_list = list(udid_list - set([x[0] for x in bind_udid_list])) token_number = len(udid_list) download_token_queryset = AppDownloadToken.objects.filter(app_id=app_obj).annotate(