From 950183ca85f0e2e80113fc79ad2da5d028dd9ff7 Mon Sep 17 00:00:00 2001 From: jiangweidong Date: Thu, 9 Mar 2023 11:18:51 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E6=93=8D=E4=BD=9C=E6=97=A5=E5=BF=97?= =?UTF-8?q?=E5=8F=AF=E8=83=BD=E4=BF=9D=E5=AD=98=E6=98=8E=E6=96=87=E5=AF=86?= =?UTF-8?q?=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/common/local.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/apps/common/local.py b/apps/common/local.py index 19b00537e..41b0cffe3 100644 --- a/apps/common/local.py +++ b/apps/common/local.py @@ -1,7 +1,10 @@ from werkzeug.local import Local +from django.utils import translation + + thread_local = Local() -encrypted_field_set = {'password'} +encrypted_field_set = {'password', 'secret'} def _find(attr): @@ -10,4 +13,5 @@ def _find(attr): def add_encrypted_field_set(label): if label: - encrypted_field_set.add(str(label)) + with translation.override('en'): + encrypted_field_set.add(str(label))