refactor: xpack license
This commit is contained in:
parent
1ea78ea0c7
commit
d8ca74a2f5
@ -39,8 +39,8 @@ class ChatEmbedSerializer(serializers.Serializer):
|
|||||||
is_draggable = 'false'
|
is_draggable = 'false'
|
||||||
show_guide = 'true'
|
show_guide = 'true'
|
||||||
float_icon = f"{self.data.get('protocol')}://{self.data.get('host')}/ui/MaxKB.gif"
|
float_icon = f"{self.data.get('protocol')}://{self.data.get('host')}/ui/MaxKB.gif"
|
||||||
xpack_cache = DatabaseModelManage.get_model('xpack_cache')
|
is_license_valid = DatabaseModelManage.get_model('license_is_valid')
|
||||||
X_PACK_LICENSE_IS_VALID = False if xpack_cache is None else xpack_cache.get('XPACK_LICENSE_IS_VALID', False)
|
X_PACK_LICENSE_IS_VALID = is_license_valid if is_license_valid is not None else False
|
||||||
# 获取接入的query参数
|
# 获取接入的query参数
|
||||||
query = self.get_query_api_input(application_access_token.application, params)
|
query = self.get_query_api_input(application_access_token.application, params)
|
||||||
float_location = {"x": {"type": "right", "value": 0}, "y": {"type": "bottom", "value": 30}}
|
float_location = {"x": {"type": "right", "value": 0}, "y": {"type": "bottom", "value": 30}}
|
||||||
|
|||||||
@ -237,8 +237,8 @@ def query_params_to_single_dict(query_params: Dict):
|
|||||||
def valid_license(model=None, count=None, message=None):
|
def valid_license(model=None, count=None, message=None):
|
||||||
def inner(func):
|
def inner(func):
|
||||||
def run(*args, **kwargs):
|
def run(*args, **kwargs):
|
||||||
xpack_cache = DatabaseModelManage.get_model('xpack_cache')
|
is_license_valid = DatabaseModelManage.get_model('license_is_valid')
|
||||||
is_license_valid = xpack_cache.get('XPACK_LICENSE_IS_VALID', False) if xpack_cache is not None else False
|
is_license_valid = is_license_valid if is_license_valid is not None else False
|
||||||
record_count = QuerySet(model).count()
|
record_count = QuerySet(model).count()
|
||||||
|
|
||||||
if not is_license_valid and record_count >= count:
|
if not is_license_valid and record_count >= count:
|
||||||
|
|||||||
@ -57,6 +57,7 @@ pypdf = "5.6.0"
|
|||||||
gunicorn = "23.0.0"
|
gunicorn = "23.0.0"
|
||||||
python-daemon = "3.1.2"
|
python-daemon = "3.1.2"
|
||||||
pytz = "2025.2"
|
pytz = "2025.2"
|
||||||
|
django-apscheduler = "0.6.2"
|
||||||
|
|
||||||
[build-system]
|
[build-system]
|
||||||
requires = ["poetry-core"]
|
requires = ["poetry-core"]
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user