From 85700a2a26bd35c17dab28113c61f3fd0ad471db Mon Sep 17 00:00:00 2001 From: ibuler Date: Tue, 25 Jun 2024 14:21:29 +0800 Subject: [PATCH] perf: some word translate --- apps/assets/const/automation.py | 2 +- apps/i18n/lina/en.json | 2 +- apps/users/models/user.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/apps/assets/const/automation.py b/apps/assets/const/automation.py index 4a2054db1..135102312 100644 --- a/apps/assets/const/automation.py +++ b/apps/assets/const/automation.py @@ -4,7 +4,7 @@ from django.utils.translation import gettext_lazy as _ class Connectivity(TextChoices): UNKNOWN = '-', _('Unknown') - OK = 'ok', _('Ok') + OK = 'ok', _('OK') ERR = 'err', _('Error') diff --git a/apps/i18n/lina/en.json b/apps/i18n/lina/en.json index 893a78918..efc506850 100644 --- a/apps/i18n/lina/en.json +++ b/apps/i18n/lina/en.json @@ -292,7 +292,7 @@ "Confirm": "Confirm", "ConfirmPassword": "Confirm password", "Connect": "Connect", - "ConnectAssets": "Connect assets", + "ConnectAssets": "Access assets", "ConnectMethod": "Connect method", "ConnectMethodACLHelpMsg": "Connect methods can be filtered to control whether users can use a certain connect method to login to the asset. according to your set rules, some connect methods can be allowed, while others can be prohibited (globally effective).", "ConnectMethodACLHelpText": "Connect methods can be filtered to control whether users can use a certain connect method to login to the asset. according to your set rules, some connect methods can be allowed, while others can be prohibited.", diff --git a/apps/users/models/user.py b/apps/users/models/user.py index 895cff582..deb1022dd 100644 --- a/apps/users/models/user.py +++ b/apps/users/models/user.py @@ -776,7 +776,7 @@ class JSONFilterMixin: if match == "m2m_all": user_id = ( bindings.values("user_id") - .annotate(count=Count("user_id", distinct=True)) + .annotate(count=Count("user_id")) # 这里不能有 distinct 会导致 count 不准确, acls 中过滤用户时会出现问题 .filter(count=len(value)) .values_list("user_id", flat=True) )