2021-01-26 09:54:12 +00:00
|
|
|
from werkzeug.local import Local
|
2019-06-25 06:32:25 +00:00
|
|
|
|
2023-03-09 03:15:18 +00:00
|
|
|
from django.utils import translation
|
|
|
|
|
|
|
|
|
2019-06-25 06:32:25 +00:00
|
|
|
thread_local = Local()
|
2023-03-09 03:15:18 +00:00
|
|
|
encrypted_field_set = {'password', 'secret'}
|
2019-06-25 06:32:25 +00:00
|
|
|
|
|
|
|
|
|
|
|
def _find(attr):
|
|
|
|
return getattr(thread_local, attr, None)
|
2022-11-04 06:22:38 +00:00
|
|
|
|
|
|
|
|
|
|
|
def add_encrypted_field_set(label):
|
2024-05-27 03:13:13 +00:00
|
|
|
return
|
2022-11-04 06:22:38 +00:00
|
|
|
if label:
|
2023-03-09 03:15:18 +00:00
|
|
|
with translation.override('en'):
|
|
|
|
encrypted_field_set.add(str(label))
|