diff options
author | Chris Ball <cjb@laptop.org> | 2010-06-24 18:13:06 -0400 |
---|---|---|
committer | Chris Ball <cjb@laptop.org> | 2010-06-24 18:13:06 -0400 |
commit | cfea170cbc0c35b1c2d603815cdd18124391a385 (patch) | |
tree | a2abbc28c3fdba677f3c9b30000e8eaea333bbac | |
parent | fcb8f9611d942fa265c5ece8d29464896c4b8241 (diff) | |
download | bugseverywhere-cfea170cbc0c35b1c2d603815cdd18124391a385.tar.gz |
cfbe: API: Report each of the targets a bug has
-rw-r--r-- | interfaces/web/web.py | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/interfaces/web/web.py b/interfaces/web/web.py index 473054b..e80f676 100644 --- a/interfaces/web/web.py +++ b/interfaces/web/web.py @@ -1,6 +1,7 @@ import cherrypy from libbe import storage from libbe import bugdir +from libbe.command.depend import get_blocks from libbe.command.util import bug_comment_from_user_id from libbe.storage.util import settings_object from jinja2 import Environment, FileSystemLoader @@ -111,9 +112,20 @@ class WebInterface: template = self.env.get_template('bug.html') common_info = self.get_common_information() + + # Determine which targets a bug has. + # First, is this bug blocking any other bugs? + targets = '' + blocks = get_blocks(self.bd, bug) + for targetbug in blocks: + # Are any of those blocked bugs targets? + blocker = self.bd.bug_from_uuid(targetbug.uuid) + if blocker.severity == "target": + targets += "%s " % blocker.summary + return template.render(bug=bug, bd=self.bd, assignee='' if bug.assigned == EMPTY else bug.assigned, - target='' if bug.target == EMPTY else bug.target, + target=targets, assignees=common_info['possible_assignees'], targets=common_info['possible_targets'], statuses=common_info['possible_statuses'], |