rrs/models.py: RecipeUpgrade fix selection by milestone.

Signed-off-by: Aníbal Limón <anibal.limon@linux.intel.com>
This commit is contained in:
Aníbal Limón 2015-07-01 17:16:33 -05:00 committed by Paul Eggleton
parent 607e5f141b
commit 954e81d27a

View File

@ -341,7 +341,7 @@ class RecipeUpgrade(models.Model):
def get_by_recipe_and_date(recipe, end_date):
ru = RecipeUpgrade.objects.filter(recipe = recipe,
commit_date__lte = end_date)
return ru[0] if ru else None
return ru[len(ru) - 1] if ru else None
def short_sha1(self):
return self.sha1[0:6]