Skip to content

Commit 8532a54

Browse files
renzonrenzon
authored andcommitted
Fixed bug of parameter start on funciton sum
close #1903
1 parent fe9f85f commit 8532a54

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

pythonpro/dashboard/facade.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,13 @@ def calculate_module_progresses(user):
5858
'duration': 0,
5959
}
6060

61-
sum_with_start_0 = partial(sum, start=0)
61+
# this is here due to bug on Heroku which is not installing Python 3.8:
62+
# https://sentry.io/organizations/python-pro/issues/1471675608/?project=236278&query=is%3Aunresolved
63+
def sum_with_start_0(lst):
64+
lst = list(lst)
65+
if len(lst) == 0:
66+
return 0
67+
return sum(lst)
6268

6369
aggregation_functions = {
6470
'last_interaction': partial(max, default=default_min_time),

0 commit comments

Comments
 (0)