From 7b9cea66a4ce32a14ccc7a85d2ced30cc8e56fac Mon Sep 17 00:00:00 2001 From: Paul Eggleton Date: Mon, 12 Feb 2018 14:27:54 +1300 Subject: [PATCH] update_classic_status: fix matching on wrong layer We were sorting the layers in the wrong order when trying to choose which layer to pick a matching recipe from - it needs to be descending priority order, not ascending. Signed-off-by: Paul Eggleton --- layerindex/tools/update_classic_status.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/layerindex/tools/update_classic_status.py b/layerindex/tools/update_classic_status.py index f980e64..be7807d 100755 --- a/layerindex/tools/update_classic_status.py +++ b/layerindex/tools/update_classic_status.py @@ -68,7 +68,7 @@ def main(): try: with transaction.atomic(): def recipe_pn_query(pn): - return Recipe.objects.filter(layerbranch__branch__name='master').filter(pn=pn).order_by('layerbranch__layer__index_preference') + return Recipe.objects.filter(layerbranch__branch__name='master').filter(pn=pn).order_by('-layerbranch__layer__index_preference') recipequery = ClassicRecipe.objects.filter(layerbranch=layerbranch).filter(cover_status__in=['U', 'N']) for recipe in recipequery: