diff --git a/lib/mentat/stats/idea.py b/lib/mentat/stats/idea.py index 354118c651c3182783eb77d858197cdea8c7bb51..4008defbe8528fefe58ca50375489a3a29540f82 100644 --- a/lib/mentat/stats/idea.py +++ b/lib/mentat/stats/idea.py @@ -429,6 +429,11 @@ def aggregate_stats_reports(report_list, dt_from, dt_to, result = None): # Precalculate list of timeline keys for further bisection search. tl_keys = [x[0] for x in result[ST_SKEY_TIMELINE]] + # Set the default count of report types to 0. Fixes issue #7627. + for report_type_key in (ST_SKEY_CNT_REPS_S, ST_SKEY_CNT_REPS_E): + if report_type_key not in result: + result[report_type_key] = 0 + for report in report_list: report_ct = report.createtime