diff --git a/.last-branch b/.last-branch index 1d633b1..d601c96 100644 --- a/.last-branch +++ b/.last-branch @@ -1 +1 @@ -v20260103-03-reports-loading-fix +v20260103-04-reports-default-period-fix diff --git a/containers/backupchecks/src/backend/app/main/routes_reports.py b/containers/backupchecks/src/backend/app/main/routes_reports.py index 24b22a7..536dfad 100644 --- a/containers/backupchecks/src/backend/app/main/routes_reports.py +++ b/containers/backupchecks/src/backend/app/main/routes_reports.py @@ -1,5 +1,12 @@ from .routes_shared import * # noqa: F401,F403 +def get_default_report_period(): + """Return default report period (last 7 days).""" + period_end = date.today() + period_start = period_end - timedelta(days=7) + return period_start, period_end + + def _safe_json_list(value): if not value: diff --git a/docs/changelog.md b/docs/changelog.md index 1e615b7..670afda 100644 --- a/docs/changelog.md +++ b/docs/changelog.md @@ -21,6 +21,14 @@ - Fixed customer selection components on the Reports pages that could remain in a loading state. - Improved robustness of report data handling to prevent rendering issues caused by invalid or missing customer references. +--- + +## v20260103-04-reports-default-period-fix + +- Fixed a NameError on the Reports page by adding the missing get_default_report_period helper. +- Ensured a default reporting period is always available to prevent the Reports view from failing during load. + + ================================================================================================================================================ ## v0.1.15