From 2395f919fae3fe12a88d3f6254915644a97c3710 Mon Sep 17 00:00:00 2001 From: renzon Date: Fri, 24 Jan 2020 21:00:19 -0300 Subject: [PATCH] Fixed bug of parameter start on funciton sum close #1903 --- pythonpro/dashboard/facade.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/pythonpro/dashboard/facade.py b/pythonpro/dashboard/facade.py index ba1079c8..b13cf10e 100644 --- a/pythonpro/dashboard/facade.py +++ b/pythonpro/dashboard/facade.py @@ -58,7 +58,13 @@ def calculate_module_progresses(user): 'duration': 0, } - sum_with_start_0 = partial(sum, start=0) +# this is here due to bug on Heroku which is not installing Python 3.8: +# https://sentry.io/organizations/python-pro/issues/1471675608/?project=236278&query=is%3Aunresolved + def sum_with_start_0(lst): + lst = list(lst) + if len(lst) == 0: + return 0 + return sum(lst) aggregation_functions = { 'last_interaction': partial(max, default=default_min_time),