diff --git a/apps/enm/tasks.py b/apps/enm/tasks.py index 450631a5..6910f5f2 100644 --- a/apps/enm/tasks.py +++ b/apps/enm/tasks.py @@ -358,6 +358,7 @@ def cal_enstat(type, sflogId, mgroupId, year, month, day, hour, year_s, month_s, this_cal_attrs = cal_attrs[:] mgroup = Mgroup.objects.get(id=mgroupId) + sflog = None # 默认无班次 if sflogId: sflog = SfLog.objects.get(id=sflogId) elif year and month and day and hour is not None: