From e46aa9598037f2851efcd1ad83eca8509ab50cb6 Mon Sep 17 00:00:00 2001 From: feng <1304903146@qq.com> Date: Tue, 29 Jul 2025 17:43:01 +0800 Subject: [PATCH] perf: check_asset_permission_will_expired filter is_active=True --- apps/perms/tasks.py | 1 + apps/terminal/hands.py | 2 -- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/apps/perms/tasks.py b/apps/perms/tasks.py index f52348060..1788a7cea 100644 --- a/apps/perms/tasks.py +++ b/apps/perms/tasks.py @@ -65,6 +65,7 @@ def check_asset_permission_will_expired(): org_perm_remain_day_mapper = defaultdict(dict) asset_perms = AssetPermission.objects.filter( + is_active=True, date_expired__gte=start, date_expired__lte=end ).distinct() diff --git a/apps/terminal/hands.py b/apps/terminal/hands.py index 6f4c6c78f..b05681258 100644 --- a/apps/terminal/hands.py +++ b/apps/terminal/hands.py @@ -1,5 +1,3 @@ # -*- coding: utf-8 -*- # -from users.models import User -from assets.models import SystemUser