fix: except ZeroDivisionError
This commit is contained in:
parent
a609b1db94
commit
60ac9e6ac2
|
@ -404,8 +404,11 @@ def cal_enstat(type, sflogId, mgroupId, year, month, day, hour, year_s, month_s,
|
|||
if type != 'hour_s' and 'run_hour' in this_cal_attrs:
|
||||
enstat.total_hour_now, enstat.shut_hour = get_total_hour_now_and_shut_hour(enstat)
|
||||
enstat.run_hour = enstat.total_hour_now - enstat.shut_hour
|
||||
enstat.run_rate = (enstat.run_hour / enstat.total_hour_now)*100
|
||||
enstat.production_hour = enstat.total_production / enstat.total_hour_now
|
||||
try:
|
||||
enstat.run_rate = (enstat.run_hour / enstat.total_hour_now)*100
|
||||
enstat.production_hour = enstat.total_production / enstat.total_hour_now
|
||||
except ZeroDivisionError:
|
||||
pass
|
||||
enstat.save()
|
||||
enstat.save()
|
||||
|
||||
|
|
Loading…
Reference in New Issue