fix: 操作日志可能保存明文密码

pull/9911/head
jiangweidong 2023-03-09 11:18:51 +08:00 committed by Jiangjie.Bai
parent 6b1aa752d6
commit 950183ca85
1 changed files with 6 additions and 2 deletions

View File

@ -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))