Skip to content

Commit

Permalink
Exclude BETA images from latest query
Browse files Browse the repository at this point in the history
  • Loading branch information
major authored and F-X64 committed Jun 13, 2024
1 parent 0aa81d6 commit 4bedefb
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion cid/crud.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,10 @@ def latest_aws_image(db: Session) -> dict[str, Any]:
"""Get the latest RHEL image on AWS."""
# Find the image with the highest version number and the latest date.
latest_image = (
db.query(AwsImage).order_by(desc(AwsImage.version), desc(AwsImage.date)).first()
db.query(AwsImage)
.filter(AwsImage.name.notlike("%BETA%"))
.order_by(desc(AwsImage.version), desc(AwsImage.date))
.first()
)

if latest_image is None:
Expand Down

0 comments on commit 4bedefb

Please sign in to comment.