Skip to content

Commit 2a91fd9

Browse files
committed
frontend: fix a SQLAlchemy warning
<stdin>:1: SAWarning: SELECT statement has a cartesian product between FROM element(s) "mock_chroot" and FROM element "copr_chroot". Apply join condition(s) between each element to resolve.
1 parent fde1bd2 commit 2a91fd9

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

frontend/coprs_frontend/coprs/logic/coprs_logic.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1267,7 +1267,9 @@ def filter_outdated(cls, query):
12671267
12681268
See https://docs.pagure.org/copr.copr/developer_documentation/eol-logic.html
12691269
"""
1270-
return (query.filter(models.CoprChroot.delete_after
1270+
return (query
1271+
.join(models.CoprChroot.mock_chroot)
1272+
.filter(models.CoprChroot.delete_after
12711273
>= datetime.datetime.now())
12721274
# Filter out chroots that are manually disabled by user
12731275
# (deleted, aka "unclicked", we never send e-mails there)

0 commit comments

Comments
 (0)