diff --git a/plinth/modules/upgrades/distupgrade.py b/plinth/modules/upgrades/distupgrade.py index 964ac66fa..d32aace94 100644 --- a/plinth/modules/upgrades/distupgrade.py +++ b/plinth/modules/upgrades/distupgrade.py @@ -116,6 +116,9 @@ def _get_sources_list_codename() -> str | None: dists = set() for match_ in aug.match('*'): dist = aug.get(match_ + '/distribution') + if not dist: + continue + dist = dist.removesuffix('-updates') dist = dist.removesuffix('-security') dists.add(dist) diff --git a/plinth/modules/upgrades/tests/test_distupgrade.py b/plinth/modules/upgrades/tests/test_distupgrade.py index 6484c9f6f..52f3cfaff 100644 --- a/plinth/modules/upgrades/tests/test_distupgrade.py +++ b/plinth/modules/upgrades/tests/test_distupgrade.py @@ -190,7 +190,7 @@ def test_get_status(check_auto, is_dist_upgrade_enabled, assert status['current_release_date'] == current_date assert status['next_codename'] == 'trixie' assert status['next_version'] == 13 - next_date = datetime_original(2025, 8, 20, tzinfo=timezone.utc) + next_date = datetime_original(2025, 8, 9, tzinfo=timezone.utc) assert status['next_release_date'] == next_date assert status['next_action'] == 'manual'