Skip to content

Commit d8ca74a

Browse files
committed
refactor: xpack license
1 parent 1ea78ea commit d8ca74a

File tree

3 files changed

+5
-4
lines changed

3 files changed

+5
-4
lines changed

apps/chat/serializers/chat_embed_serializers.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,8 @@ def get_embed(self, with_valid=True, params=None):
3939
is_draggable = 'false'
4040
show_guide = 'true'
4141
float_icon = f"{self.data.get('protocol')}://{self.data.get('host')}/ui/MaxKB.gif"
42-
xpack_cache = DatabaseModelManage.get_model('xpack_cache')
43-
X_PACK_LICENSE_IS_VALID = False if xpack_cache is None else xpack_cache.get('XPACK_LICENSE_IS_VALID', False)
42+
is_license_valid = DatabaseModelManage.get_model('license_is_valid')
43+
X_PACK_LICENSE_IS_VALID = is_license_valid if is_license_valid is not None else False
4444
# 获取接入的query参数
4545
query = self.get_query_api_input(application_access_token.application, params)
4646
float_location = {"x": {"type": "right", "value": 0}, "y": {"type": "bottom", "value": 30}}

apps/common/utils/common.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -237,8 +237,8 @@ def query_params_to_single_dict(query_params: Dict):
237237
def valid_license(model=None, count=None, message=None):
238238
def inner(func):
239239
def run(*args, **kwargs):
240-
xpack_cache = DatabaseModelManage.get_model('xpack_cache')
241-
is_license_valid = xpack_cache.get('XPACK_LICENSE_IS_VALID', False) if xpack_cache is not None else False
240+
is_license_valid = DatabaseModelManage.get_model('license_is_valid')
241+
is_license_valid = is_license_valid if is_license_valid is not None else False
242242
record_count = QuerySet(model).count()
243243

244244
if not is_license_valid and record_count >= count:

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ pypdf = "5.6.0"
5757
gunicorn = "23.0.0"
5858
python-daemon = "3.1.2"
5959
pytz = "2025.2"
60+
django-apscheduler = "0.6.2"
6061

6162
[build-system]
6263
requires = ["poetry-core"]

0 commit comments

Comments
 (0)