From 75ec65f7052c5cdfb73103a5c7d5c8a82b26fc9b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20Dlouh=C3=BD?= Date: Wed, 11 Oct 2023 15:14:57 +0200 Subject: [PATCH] recalculate_charts: recalculate also blank presets --- .../management/commands/recalculate_charts.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/admin_tools_stats/management/commands/recalculate_charts.py b/admin_tools_stats/management/commands/recalculate_charts.py index 1e41e15b..875dd76f 100644 --- a/admin_tools_stats/management/commands/recalculate_charts.py +++ b/admin_tools_stats/management/commands/recalculate_charts.py @@ -106,11 +106,13 @@ def handle(self, *args, **options): time_scales = stats.allowed_time_scales chart_tz = get_charts_timezone() - for operation_field in stats.operation_field_name.split(","): + operation_fields = stats.operation_field_name.split(",") + [""] + + for operation_field in operation_fields: for selected_interval in time_scales: print( - f"recalculating chart {stats} with {multiseries_criteria} on " - f"{operation_field} criteria in {selected_interval}" + f"recalculating chart '{stats}' with '{multiseries_criteria}' on " + f"'{operation_field}' criteria in {selected_interval}" ) time_since = datetime.now() - timedelta( days=stats.default_time_period