mirror of
git://git.yoctoproject.org/layerindex-web.git
synced 2025-07-19 20:59:01 +02:00
rrs_upgrade_history: handle multiple recipes with same pn per layer
We should expect multiple matches for layerbranch + pn, so use filter() instead of get() and take the first id that matches. Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
This commit is contained in:
parent
fdec9d1d63
commit
c607ba6945
|
@ -62,12 +62,12 @@ def _create_upgrade(recipe_data, layerbranch, ct, title, info, logger, initial=F
|
|||
pn = recipe_data.getVar('PN', True)
|
||||
pv = recipe_data.getVar('PV', True)
|
||||
|
||||
try:
|
||||
recipe = Recipe.objects.get(pn=pn, layerbranch=layerbranch)
|
||||
except Exception as e:
|
||||
recipes = Recipe.objects.filter(pn=pn, layerbranch=layerbranch).order_by('id')
|
||||
if not recipes:
|
||||
logger.warn("%s: Not found in Layer branch %s." %
|
||||
(pn, str(layerbranch)))
|
||||
return
|
||||
recipe = recipes[0]
|
||||
|
||||
try:
|
||||
latest_upgrade = RecipeUpgrade.objects.filter(
|
||||
|
|
Loading…
Reference in New Issue
Block a user