From 903233b8b33ee9b61b6837fdfacc9c00d4f16bae Mon Sep 17 00:00:00 2001 From: Jakub Kadlcik Date: Apr 30 2021 12:25:27 +0000 Subject: frontend: not display EOL warning for unclicked chroots I thought the join will be done implicitly but apparently not. Without it, the `.filter(not_(models.MockChroot.is_active))` always returns `True` and therefore we display the "Some of the chroots you maintain are newly marked EOL" warning even if there are no EOL chroots. --- diff --git a/frontend/coprs_frontend/coprs/logic/outdated_chroots_logic.py b/frontend/coprs_frontend/coprs/logic/outdated_chroots_logic.py index 1c571e3..a524fab 100644 --- a/frontend/coprs_frontend/coprs/logic/outdated_chroots_logic.py +++ b/frontend/coprs_frontend/coprs/logic/outdated_chroots_logic.py @@ -22,7 +22,7 @@ class OutdatedChrootsLogic: soon = now + timedelta(days=period) reviewed = [x.copr_chroot_id for x in cls.get_all_reviews(user).all()] - return bool((models.CoprChroot.query + return bool((models.CoprChroot.query.join(models.CoprChroot.mock_chroot) .filter(models.CoprChroot.copr_id.in_(projects_ids)) .filter(models.CoprChroot.delete_after.isnot(None)) .filter(models.CoprChroot.delete_after <= soon)