From 52fc0c6bd3ba68ae038f5d854761f8d3de0426d9 Mon Sep 17 00:00:00 2001 From: caoqianming Date: Tue, 7 May 2024 11:09:19 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20translate=5Feval=5Fformula=20enm=5Flhxs?= =?UTF-8?q?=E7=9A=84=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/enm/services.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/enm/services.py b/apps/enm/services.py index 8295993b..0f436ac9 100644 --- a/apps/enm/services.py +++ b/apps/enm/services.py @@ -24,7 +24,7 @@ def translate_eval_formula(exp_str: str, year: int, month: int, day: int, hour: matches = re.findall(pattern, exp_str) for match in matches: if match in ['enm_lhxs']: - exp_str = exp_str.replace(f"{{{match}}}", get_sysconfig(f'enm.{match}')) + exp_str = exp_str.replace(f"{{{match}}}", str(get_sysconfig(f'enm.{match}'))) else: mpst = MpointStat.objects.filter(Q(mpoint__id=match) | Q(mpoint__name=match) | Q(mpoint__code=match), type="hour", year=year, month=month, day=day, hour=hour).first() if mpst: