mirror of
git://git.yoctoproject.org/layerindex-web.git
synced 2025-07-19 20:59:01 +02:00
rrs: Fix last updated.
Don't conditional last updated to upstream status. Signed-off-by: Aníbal Limón <anibal.limon@linux.intel.com>
This commit is contained in:
parent
4936eaa65a
commit
b2e04c0a9e
|
@ -449,15 +449,9 @@ class Raw():
|
|||
def get_reup_by_last_updated(date):
|
||||
""" Get last time the Recipes were upgraded """
|
||||
cur = connection.cursor()
|
||||
cur.execute("""SELECT te.recipe_id, te.status, te.date, te.rownum FROM(
|
||||
SELECT recipe_id, status, date, ROW_NUMBER() OVER(
|
||||
PARTITION BY recipe_id
|
||||
ORDER BY date DESC
|
||||
) AS rownum
|
||||
FROM rrs_RecipeUpstream
|
||||
WHERE status = 'Y'
|
||||
AND date <= %s) AS te
|
||||
WHERE te.rownum = 1;
|
||||
cur.execute("""SELECT recipe_id, MAX(commit_date) AS date
|
||||
FROM rrs_recipeupgrade
|
||||
GROUP BY recipe_id;
|
||||
""", [date])
|
||||
return Raw.dictfetchall(cur)
|
||||
|
||||
|
|
23
rrs/views.py
23
rrs/views.py
|
@ -145,23 +145,24 @@ def _get_recipe_list(milestone):
|
|||
recipes[i]['version'] = re['pv']
|
||||
recipes_ids.append(re['id'])
|
||||
|
||||
if recipes and recipe_upstream_history:
|
||||
recipe_upstream_all = Raw.get_reup_by_recipes_and_date(
|
||||
recipes_ids, recipe_upstream_history.id)
|
||||
if recipes:
|
||||
recipe_last_updated = Raw.get_reup_by_last_updated(
|
||||
milestone.end_date)
|
||||
maintainers_all = Raw.get_ma_by_recipes_and_date(
|
||||
recipes_ids, recipe_maintainer_history[0])
|
||||
for reup in recipe_upstream_all:
|
||||
recipe_upstream_dict_all[reup['recipe_id']] = reup
|
||||
for rela in recipe_last_updated:
|
||||
recipe_last_updated_dict_all[rela['recipe_id']] = rela
|
||||
|
||||
if recipe_upstream_history:
|
||||
recipe_upstream_all = Raw.get_reup_by_recipes_and_date(
|
||||
recipes_ids, recipe_upstream_history.id)
|
||||
for reup in recipe_upstream_all:
|
||||
recipe_upstream_dict_all[reup['recipe_id']] = reup
|
||||
|
||||
if recipe_maintainer_history:
|
||||
maintainers_all = Raw.get_ma_by_recipes_and_date(
|
||||
recipes_ids, recipe_maintainer_history[0])
|
||||
for ma in maintainers_all:
|
||||
maintainers_dict_all[ma['recipe_id']] = ma['name']
|
||||
|
||||
else:
|
||||
recipe_upstream_all = None
|
||||
|
||||
for recipe in recipes:
|
||||
upstream_version = ''
|
||||
upstream_status = ''
|
||||
|
@ -201,8 +202,6 @@ def _get_recipe_list(milestone):
|
|||
if recipe_last_updated:
|
||||
recipe_date = recipe_last_updated['date']
|
||||
outdated = recipe_date.date().isoformat()
|
||||
else:
|
||||
outdated = 'Unknown'
|
||||
else:
|
||||
outdated = 'Up-to-date'
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user