views.py: Fix current up to date percentage
PATCH 1/1 views.py: Fix current up to date percentage
From: Mariano Lopez <[email protected]>
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 <[email protected]>
--- rrs/models.py | 5 +++++ rrs/views.py | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-)
rrs/models.py +5 -0
@@ -272,6 +272,11 @@ class RecipeUpstream(models.Model): date = models.DateTimeField(db_index=True) @staticmethod + def get_all_recipes(history): + qry = RecipeUpstream.objects.filter(history = history) + return qry + + @staticmethod def get_recipes_not_updated(history): qry = RecipeUpstream.objects.filter(history = history, status = 'N', no_update_reason = '').order_by('pn')
rrs/views.py +2 -2
@@ -42,8 +42,8 @@ def _get_milestone_statistics(milestone, maintainer_name=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'] = \ RecipeUpstream.get_recipes_up_to_date(recipe_upstream_history).count() milestone_statistics['not_updated'] = \
Signature · 1 line
1.9.1