diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 11c4a0c8cf6dbdc9311a8490ce1998c30279507d..16b9cccd10b3bd4dbb2f4dca4f18098634aa177e 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -6,6 +6,14 @@ All notable changes to this project will be documented in this file. The format is based on `Keep a Changelog`_, and this project adheres to `Semantic Versioning`_. +Unreleased +---------- + +Fixed +~~~~~ + +* Fix broken backup health check + `2.0b1`_ - 2021-06-01 --------------------- diff --git a/aleksis/core/health_checks.py b/aleksis/core/health_checks.py index c3ad7b4b17a944acf9f2af00a0c461e958e140d8..200a6eaf0a35a75c29ca4cf7e8c564925b1e29e8 100644 --- a/aleksis/core/health_checks.py +++ b/aleksis/core/health_checks.py @@ -38,9 +38,9 @@ class BaseBackupHealthCheck(BaseHealthCheckBackend): self.add_error(_("The backup folder doesn't exist.")) return if backups: - last_backup = backups[-1] - last_backup_time = dbbackup_utils.filename_to_date(last_backup) - time_gone_since_backup = last_backup_time - datetime.now() + last_backup = backups[:1] + last_backup_time = dbbackup_utils.filename_to_date(last_backup[0]) + time_gone_since_backup = datetime.now() - last_backup_time # Check if backup is older than configured time if time_gone_since_backup.seconds > self.configured_seconds: