-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
Closed
Labels
BugA bugA bugNeeded: design decisionA core team decision is requiredA core team decision is required
Description
Noticed and partially fixed in #12225, these two methods can result in different queries to the list of builds:
Project.objects.get(pk=123).get_latest_build()
Project.objects.prefetch_latest_build().get(pk=123).get_latest_build()
This is because get_latest_build()
uses a different query filter and takes a finished=True
argument by default, however when using prefetch the query filter is different and completely discards the fishined
argument.
The get_latest_build()
method is not used in many places and mostly just from templates. We could either make the query match when using/not using prefetch, or just only allow this method when builds are prefetched -- throwing an exception otherwise. I didn't chase down a solution to this, I was working on an unrelated fix.
Metadata
Metadata
Assignees
Labels
BugA bugA bugNeeded: design decisionA core team decision is requiredA core team decision is required