Skip to content

Commit

Permalink
recalculate_charts: recalculate also blank presets
Browse files Browse the repository at this point in the history
  • Loading branch information
PetrDlouhy committed Aug 2, 2024
1 parent bda5708 commit 124f34d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ Changelog
* values in divided chart now are filtered by other criteria choices
* removed support for other JSONFields than Django's native JSONField, removed ADMIN_CHARTS_USE_JSONFIELD setting
* admin charts are loaded by JS including chart controls for quicker admin index load
* --time-until option was added to the `recalculate_charts` management command to recalculate charts only until given date

1.3.1 (2024-04-12)
------------------
Expand Down
8 changes: 5 additions & 3 deletions admin_tools_stats/management/commands/recalculate_charts.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 124f34d

Please sign in to comment.