views.py: Fix current up to date percentage

There was an issue where the current up to date was always
using the latest upstream version to get the percentage.
This uses the upstream version in the period displayed.

Signed-off-by: Mariano Lopez <mariano.lopez@linux.intel.com>
This commit is contained in:
Mariano Lopez 2015-07-01 14:28:42 -05:00 committed by Aníbal Limón
parent d4dd443421
commit 9a134fc367
2 changed files with 7 additions and 2 deletions

View File

@ -271,6 +271,11 @@ class RecipeUpstream(models.Model):
no_update_reason = models.CharField(max_length=255, blank=True, db_index=True) no_update_reason = models.CharField(max_length=255, blank=True, db_index=True)
date = models.DateTimeField(db_index=True) date = models.DateTimeField(db_index=True)
@staticmethod
def get_all_recipes(history):
qry = RecipeUpstream.objects.filter(history = history)
return qry
@staticmethod @staticmethod
def get_recipes_not_updated(history): def get_recipes_not_updated(history):
qry = RecipeUpstream.objects.filter(history = history, status = 'N', qry = RecipeUpstream.objects.filter(history = history, status = 'N',

View File

@ -42,8 +42,8 @@ def _get_milestone_statistics(milestone, maintainer_name=None):
) )
if maintainer_name is None: if maintainer_name is None:
milestone_statistics['all'] = Recipe.objects.all().count() milestone_statistics['all'] = \
RecipeUpstream.get_all_recipes(recipe_upstream_history).count()
milestone_statistics['up_to_date'] = \ milestone_statistics['up_to_date'] = \
RecipeUpstream.get_recipes_up_to_date(recipe_upstream_history).count() RecipeUpstream.get_recipes_up_to_date(recipe_upstream_history).count()
milestone_statistics['not_updated'] = \ milestone_statistics['not_updated'] = \