From 314b614c53342a10ff3f393e76dff1e9e724c6a7 Mon Sep 17 00:00:00 2001 From: zty Date: Tue, 6 Aug 2024 19:00:38 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20cal=5Fexp=5Fduration=5Fsec=20=E8=BF=98?= =?UTF-8?q?=E9=9C=80=E8=A6=81=E6=9B=B4=E6=96=B0=E6=97=B6=E9=97=B4=E4=B8=BA?= =?UTF-8?q?None3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/wpm/tasks.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/wpm/tasks.py b/apps/wpm/tasks.py index 6dafc52d..9dd6e657 100644 --- a/apps/wpm/tasks.py +++ b/apps/wpm/tasks.py @@ -70,7 +70,7 @@ def cal_exp_duration_sec(stlogId: str='', all=False, now: datetime=None): if now is None: now = timezone.now() for stlog in stlogs: - if stlog.duration_sec is None and stlog.end_time is not None: + if stlog.duration_sec is None and stlog.end_time: stlog.duration_sec = (stlog.end_time-stlog.start_time).total_seconds() stlog.save() is_shutdown_stlog = True