fix: cal_exp_duration_sec 还需要更新时间为None3
This commit is contained in:
parent
1fe8c7ae76
commit
314b614c53
|
|
@ -70,7 +70,7 @@ def cal_exp_duration_sec(stlogId: str='', all=False, now: datetime=None):
|
||||||
if now is None:
|
if now is None:
|
||||||
now = timezone.now()
|
now = timezone.now()
|
||||||
for stlog in stlogs:
|
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.duration_sec = (stlog.end_time-stlog.start_time).total_seconds()
|
||||||
stlog.save()
|
stlog.save()
|
||||||
is_shutdown_stlog = True
|
is_shutdown_stlog = True
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue