Filter out status entries that don't have a mood associated from average_mood

This commit is contained in:
Kumi 2021-01-01 21:46:38 +01:00
parent 7b7b27bd7d
commit a1505bed44

View file

@ -51,7 +51,8 @@ def average_mood(context, start, end=None):
moods = list()
for status in status_list:
moods.append(status.mood.value)
if status.mood:
moods.append(status.mood.value)
try:
average = sum(moods) / len(moods)