From bab6e083bfca58f022e2621699f6cab8d9a85c71 Mon Sep 17 00:00:00 2001 From: youngS Date: Fri, 10 Sep 2021 10:46:04 +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/base_views.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/fir_ser/api/base_views.py b/fir_ser/api/base_views.py index 99e3721..f9ecd91 100644 --- a/fir_ser/api/base_views.py +++ b/fir_ser/api/base_views.py @@ -32,10 +32,6 @@ def app_delete(app_obj): storage = Storage(user_obj) has_combo = app_obj.has_combo - if has_combo: - logger.info( - f"app_id:{app_obj.app_id} has_combo ,delete this app need uncombo and clean del_cache_response_by_short") - has_combo.has_combo = None del_cache_response_by_short(app_obj.app_id) del_cache_by_delete_app(app_obj.app_id) for app_release_obj in AppReleaseInfo.objects.filter(app_id=app_obj).all(): @@ -45,6 +41,12 @@ def app_delete(app_obj): storage.delete_file(app_release_obj.icon_url) app_release_obj.delete() delete_app_screenshots_files(storage, app_obj) + if has_combo: + logger.info( + f"app_id:{app_obj.app_id} has_combo ,delete this app need uncombo and clean del_cache_response_by_short") + has_combo.has_combo = None + has_combo.save(update_fields=['has_combo']) + app_obj.delete() return res