From 05e2f8aaf67832a2b808009b19c8290e776609b3 Mon Sep 17 00:00:00 2001 From: "Jiangjie.Bai" Date: Tue, 9 Aug 2022 10:42:35 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E6=94=B9=20EncryptMixin=20get?= =?UTF-8?q?=5Fprep=5Fvalue=20=E5=92=8C=20=E9=BB=98=E8=AE=A4=E5=85=B3?= =?UTF-8?q?=E9=97=AD=20XPACK?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/common/db/fields.py | 1 + apps/jumpserver/settings/_xpack.py | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/apps/common/db/fields.py b/apps/common/db/fields.py index 8d46c9174..0757bc068 100644 --- a/apps/common/db/fields.py +++ b/apps/common/db/fields.py @@ -143,6 +143,7 @@ class EncryptMixin: value = sp.get_prep_value(value) value = force_text(value) # 替换新的加密方式 + return crypto.encrypt(value) class EncryptTextField(EncryptMixin, models.TextField): diff --git a/apps/jumpserver/settings/_xpack.py b/apps/jumpserver/settings/_xpack.py index 322740201..7a2f34c8d 100644 --- a/apps/jumpserver/settings/_xpack.py +++ b/apps/jumpserver/settings/_xpack.py @@ -6,8 +6,8 @@ from .. import const from .base import INSTALLED_APPS, TEMPLATES XPACK_DIR = os.path.join(const.BASE_DIR, 'xpack') -# XPACK_ENABLED = False -XPACK_ENABLED = os.path.isdir(XPACK_DIR) +XPACK_ENABLED = False +# XPACK_ENABLED = os.path.isdir(XPACK_DIR) XPACK_TEMPLATES_DIR = [] XPACK_CONTEXT_PROCESSOR = []