perf: Translate check account

pull/14986/head
wangruidong 2025-03-10 10:40:48 +08:00 committed by w940853815
parent 090ad0ba83
commit c84bc52c70
4 changed files with 226 additions and 195 deletions

View File

@ -6,6 +6,7 @@ import uuid
from django.conf import settings
from django.utils import timezone
from django.utils.translation import gettext_lazy as _
from accounts.models import Account, AccountRisk, RiskChoice
from assets.automations.base.manager import BaseManager
@ -266,17 +267,13 @@ class CheckAccountManager(BaseManager):
return "accounts/check_account_report.html"
def print_summary(self):
tmpl = (
"\n---\nSummary: \nok: %s, weak password: %s, leaked password: %s, "
"repeated password: %s, no secret: %s, using time: %ss"
% (
self.summary["ok"],
self.summary[RiskChoice.weak_password],
self.summary[RiskChoice.leaked_password],
self.summary[RiskChoice.repeated_password],
self.summary["no_secret"],
int(self.duration),
)
tmpl = _("\n---\nSummary: \nok: {}, weak password: {}, leaked password: {}, "
"repeated password: {}, no secret: {}, using time: {}s").format(
self.summary["ok"],
self.summary[RiskChoice.weak_password],
self.summary[RiskChoice.leaked_password],
self.summary[RiskChoice.repeated_password],
self.summary["no_secret"],
int(self.duration)
)
print(tmpl)

File diff suppressed because it is too large Load Diff

View File

@ -1513,5 +1513,6 @@
"ExecutionID": "Execution ID",
"Invalid": "Invalid",
"Disabled": "Disabled",
"IgnoreFail": "Ignore fail"
"IgnoreFail": "Ignore fail",
"RiskDetectionDetail": "Risk detection detail"
}

View File

@ -1512,5 +1512,6 @@
"ExecutionID": "执行 ID",
"Invalid": "无效",
"Disabled": "已禁用",
"IgnoreFail": "忽略失败"
"IgnoreFail": "忽略失败",
"RiskDetectionDetail": "风险检测详情"
}