Permalink
Browse files

Merge branch 'master' of github.com:mozilla/scrumbugz

  • Loading branch information...
2 parents a9b1c8e + ed090ea commit 64a41f9b9dcf80843399fef4c9661dbe0808009a @pmac pmac committed Jul 31, 2012
Showing with 20 additions and 2 deletions.
  1. +1 −0 scrum/models.py
  2. +1 −1 scrum/templates/scrum/sprint.html
  3. +18 −1 scrum/views.py
View
1 scrum/models.py
@@ -27,6 +27,7 @@
'priority',
'product',
'component',
+ 'depends_on',
)
BZAPI = slumber.API(settings.BZ_API_URL)
slug_re = re.compile(r'^[-.\w]+$')
View
2 scrum/templates/scrum/sprint.html
@@ -87,7 +87,7 @@
<tr data-bugid="{{ bug.id }}" id="bug{{ bug.id }}" class="bug-{{ bug.basic_status }}">
<td><a href="{{ BZ_SHOW_URL }}id={{ bug.id }}">{{ bug.id }}</a></td>
<td>{{ bug.priority }}</td>
- <td>{{ bug.summary }}</td>
+ <td>{% if bug.id in blocked_bugs %}<span class="label label-important">BLOCKED</span>{% endif %} {{ bug.summary }}</td>
<td class="ttip" title="{{ bug.assigned_to.real_name }}">{{ bug.assigned_to.name }}</td>
<td>{{ bug.user }}</td>
<td>{{ bug.component }}</td>
View
19 scrum/views.py
@@ -107,7 +107,24 @@ def get_context_data(self, **kwargs):
self.object.refresh_bugs()
context['sprint'] = self.object
try:
- context['bugs'] = self.object.get_bugs()
+ bugs = self.object.get_bugs()
+ id_to_bug = dict([(b.id, b) for b in bugs])
+ blocked_bugs = []
+
+ # Build a list of blocked_bugs where a blocked bug is any
+ # bug that depends on another bug in this sprint and that
+ # other bug is not resolved.
+ for bug in bugs:
+ if not bug.depends_on:
+ continue
+ blockers = [blocker for blocker in bug.depends_on
+ if (blocker in id_to_bug and
+ not id_to_bug[blocker].is_closed())]
+ if blockers:
+ blocked_bugs.append(bug.id)
+
+ context['blocked_bugs'] = blocked_bugs
+ context['bugs'] = bugs
context['bugs_data'] = self.process_bug_data()
context['bugs_data_json'] = json.dumps(context['bugs_data'])
context['bzerror'] = False

0 comments on commit 64a41f9

Please sign in to comment.