From 0cfcfacb6d37f0aefdf7595a0e68c66dcb09eedc Mon Sep 17 00:00:00 2001 From: Bai Date: Sun, 4 Dec 2022 22:46:47 +0800 Subject: [PATCH] =?UTF-8?q?perf:=20=E4=BF=AE=E6=94=B9=20CommandFilterACL,?= =?UTF-8?q?=20CommandGroup=20=5F=5Fstr=5F=5F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/acls/models/command_acl.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/apps/acls/models/command_acl.py b/apps/acls/models/command_acl.py index 8c920c5e7..51e8c7388 100644 --- a/apps/acls/models/command_acl.py +++ b/apps/acls/models/command_acl.py @@ -91,7 +91,7 @@ class CommandGroup(JMSOrgBaseModel): return True, '', pattern def __str__(self): - return '{} % {}'.format(self.type, self.content) + return '{} % {}'.format(self.name, self.type) class CommandFilterACLQuerySet(UserAssetAccountACLQuerySet): @@ -113,6 +113,9 @@ class CommandFilterACL(UserAssetAccountBaseACL): ordering = ('priority', '-date_updated', 'name') verbose_name = _('Command acl') + def __str__(self): + return self.name + def create_command_confirm_ticket(self, run_command, session, cmd_filter_rule, org_id): from tickets.const import TicketType from tickets.models import ApplyCommandTicket