# bug fixed add try/except

This commit is contained in:
xianfuxing 2018-08-17 22:11:38 +08:00
parent b701f48a3c
commit 2465b09e3f
1 changed files with 4 additions and 1 deletions

View File

@ -69,7 +69,10 @@ def update_daily_statistic():
_date_list.sort()
is_first = True
for d in _date_list:
obj = MosqPostStatistic.objects.get(date=d)
try:
obj = MosqPostStatistic.objects.get(date=d)
except MosqPostStatistic.DoesNotExist:
obj = None
if is_first:
if obj:
obj.total, obj.increment = ret[d], ret[d]