Replace _null with N/D on user page. Fix avg Words per day calculation.

This commit is contained in:
Alexandr Bogomyakov
2018-10-29 09:37:39 +03:00
parent 3f12596622
commit bb57b8fab3
2 changed files with 7 additions and 4 deletions

View File

@ -151,7 +151,10 @@ class DataBase:
avg = 0
for i in avg_lenght:
avg += i[0]
avg = avg / len(avg_lenght)
if len(avg_lenght) != 0:
avg = avg / len(avg_lenght)
else:
avg = 0
day_known = (datetime.now() - parser.parse(raw1[4])).days
if not day_known:
day_known = 1