diff options
author | Milo Casagrande <milo.casagrande@linaro.org> | 2014-02-19 11:00:16 +0100 |
---|---|---|
committer | Milo Casagrande <milo.casagrande@linaro.org> | 2014-02-19 11:00:16 +0100 |
commit | c980c32095e9e009556936514ef83903858b1e6f (patch) | |
tree | 3dba807e8b10a96df62b7ca4be997e8e9228c514 | |
parent | 7145358c44a562daeb7a9155b9985bfe70cf9175 (diff) | |
parent | 0951e00fd1faaff25760bc5458c05ccb92bf9441 (diff) |
Merge branch 'master' of ssh://git.linaro.org/infrastructure/roadmap
-rw-r--r-- | linaroroadmap/settings.py | 2 | ||||
-rw-r--r-- | roadmap/views.py | 13 |
2 files changed, 13 insertions, 2 deletions
diff --git a/linaroroadmap/settings.py b/linaroroadmap/settings.py index 4d13ccb..3ce28b5 100644 --- a/linaroroadmap/settings.py +++ b/linaroroadmap/settings.py @@ -28,6 +28,8 @@ JIRA_PASSWORD = None JIRA_PROJECT = '' JIRA_STATUSES = [] +# name of the resolutions that remove the closed card from the roadmap +JIRA_INVALID_RESOLUTIONS = [] # Custom field that defines relation between blueprint and engineering card # in greenhopper SFID = None diff --git a/roadmap/views.py b/roadmap/views.py index 4ff87fd..4ca8b6d 100644 --- a/roadmap/views.py +++ b/roadmap/views.py @@ -46,6 +46,7 @@ from roadmap.models import ( Component, Status, Project, + Resolution, Label, Milestone, ) @@ -278,9 +279,13 @@ def search(request): name__iexact=form.cleaned_data['label']) cards = None if label: + invalid_resolutions = Resolution.objects.filter( + project__name=settings.JIRA_PROJECT, + name__in=settings.JIRA_INVALID_RESOLUTIONS) cards = Card.objects.filter( labels__in=label, - project__name=settings.JIRA_PROJECT) + project__name=settings.JIRA_PROJECT).exclude( + resolution__in=invalid_resolutions) if not cards or cards.count() == 0: context = RequestContext(request, { 'form': form, @@ -333,7 +338,11 @@ def roadmap(request, roadmap_id): components = Component.objects.filter( project__name=settings.JIRA_PROJECT).order_by("name") current_roadmap = Component.objects.get(pk=roadmap_id) - roadmap_cards = current_roadmap.card_set.all() + invalid_resolutions = Resolution.objects.filter( + project=current_roadmap.project, + name__in=settings.JIRA_INVALID_RESOLUTIONS) + roadmap_cards = current_roadmap.card_set.all().exclude( + resolution__in=invalid_resolutions) epics = roadmap_cards.filter( # labels__name__contains="EPIC", summary__startswith="EPIC", |