From 63a4620b19e128e553870169d86d00d739f41c05 Mon Sep 17 00:00:00 2001 From: fit2bot <68588906+fit2bot@users.noreply.github.com> Date: Tue, 7 Feb 2023 20:18:54 +0800 Subject: [PATCH] perf: account push no password (#9457) Co-authored-by: feng <1304903146@qq.com> --- apps/accounts/utils.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/apps/accounts/utils.py b/apps/accounts/utils.py index 0a64e54e0..fc13a62d4 100644 --- a/apps/accounts/utils.py +++ b/apps/accounts/utils.py @@ -20,7 +20,8 @@ class SecretGenerator: return private_key def generate_password(self): - length = int(self.password_rules.get('length', DEFAULT_PASSWORD_RULES['length'])) + length = int(self.password_rules.get('length', 0)) + length = length if length else DEFAULT_PASSWORD_RULES['length'] return random_string(length, special_char=True) def get_secret(self):