Fix the EMPTY problem.
authorSteve Losh <steve@stevelosh.com>
Thu, 25 Jun 2009 21:54:18 +0000 (17:54 -0400)
committerSteve Losh <steve@stevelosh.com>
Thu, 25 Jun 2009 21:54:18 +0000 (17:54 -0400)
.be/bugs/24555ea1-76b5-40a8-918f-115a28f5f36a/values [new file with mode: 0644]
.be/bugs/312fb152-0155-45c1-9d4d-f49dd5816fbb/values [new file with mode: 0644]
.be/bugs/c7251ff9-24e4-402d-8d4e-605a78b9a91d/values [new file with mode: 0644]
templates/bug.html
web.py

diff --git a/.be/bugs/24555ea1-76b5-40a8-918f-115a28f5f36a/values b/.be/bugs/24555ea1-76b5-40a8-918f-115a28f5f36a/values
new file mode 100644 (file)
index 0000000..72629bc
--- /dev/null
@@ -0,0 +1,20 @@
+assigned: Steve Losh <steve@stevelosh.com>
+
+
+creator: Steve Losh <steve@stevelosh.com>
+
+
+severity: critical
+
+
+status: wontfix
+
+
+summary: Fix the extra severity problem.
+
+
+target: beta
+
+
+time: Thu, 25 Jun 2009 21:39:38 +0000
+
diff --git a/.be/bugs/312fb152-0155-45c1-9d4d-f49dd5816fbb/values b/.be/bugs/312fb152-0155-45c1-9d4d-f49dd5816fbb/values
new file mode 100644 (file)
index 0000000..a100dd7
--- /dev/null
@@ -0,0 +1,20 @@
+assigned: Steve Losh <steve@stevelosh.com>
+
+
+creator: Steve Losh <steve@stevelosh.com>
+
+
+severity: serious
+
+
+status: assigned
+
+
+summary: Revamp the layout/design.
+
+
+target: beta
+
+
+time: Thu, 25 Jun 2009 21:38:38 +0000
+
diff --git a/.be/bugs/c7251ff9-24e4-402d-8d4e-605a78b9a91d/values b/.be/bugs/c7251ff9-24e4-402d-8d4e-605a78b9a91d/values
new file mode 100644 (file)
index 0000000..4c1c8cb
--- /dev/null
@@ -0,0 +1,20 @@
+assigned: Steve Losh <steve@stevelosh.com>
+
+
+creator: Steve Losh <steve@stevelosh.com>
+
+
+severity: critical
+
+
+status: assigned
+
+
+summary: Document the installation.
+
+
+target: alpha
+
+
+time: Thu, 25 Jun 2009 21:41:02 +0000
+
index f9d59430ea4712cfcb065f0427b0673dcf61c0bf..3bada3830b69c9ca95c61c8a905a50c1b777c66d 100644 (file)
         <span class="detail-field-contents">{{ bug.severity }}</span><br />
         
         <span class="detail-field-header">Scheduled for:</span>
-        <span class="detail-field-contents">{{ bug.target }}</span><br />
+        <span class="detail-field-contents">{{ target }}</span><br />
         
         <span class="detail-field-header">Assigned to:</span>
-        <span class="detail-field-contents">{{ bug.assigned|e }}</span><br />
+        <span class="detail-field-contents">{{ assignee|e }}</span><br />
         
         <span class="detail-field-header">Permanent ID:</span>
         <span class="detail-field-contents">{{ bug.uuid }}</span><br />
diff --git a/web.py b/web.py
index b9df64f9be152e43b10c7ff9508d6076b83646e9..bd7a89b7725bc4ff84b4f7240274858358fd9730 100644 (file)
--- a/web.py
+++ b/web.py
@@ -1,8 +1,10 @@
 import cherrypy
-from libbe import bugdir
+from libbe import bugdir, settings_object
 from jinja2 import Environment, FileSystemLoader
 from datetime import datetime
 
+EMPTY = settings_object.EMPTY
+
 def datetimeformat(value, format='%B %d, %Y at %I:%M %p'):
     """Takes a timestamp and revormats it into a human-readable string."""
     return datetime.fromtimestamp(value).strftime(format)
@@ -21,11 +23,11 @@ class WebInterface:
     def get_common_information(self):
         """Returns a dict of common information that most pages will need."""
         possible_assignees = list(set(
-          [unicode(bug.assigned) for bug in self.bd if bug.assigned != 'None']))
+          [unicode(bug.assigned) for bug in self.bd if bug.assigned != EMPTY]))
         possible_assignees.sort(key=unicode.lower)
         
         possible_targets = list(set(
-          [unicode(bug.target) for bug in self.bd if bug.target != 'None']))
+          [unicode(bug.target) for bug in self.bd if bug.target != EMPTY]))
         possible_targets.sort(key=unicode.lower)
         
         possible_statuses = [u'open', u'assigned', u'test', u'unconfirmed', 
@@ -45,7 +47,7 @@ class WebInterface:
         bugs = [bug for bug in self.bd if bug.status in status]
         
         if assignee != '':
-            assignee = None if assignee == 'None' else assignee
+            assignee = EMPTY if assignee == 'None' else assignee
             bugs = [bug for bug in bugs if bug.assigned == assignee]
         
         if target != '':
@@ -71,9 +73,11 @@ class WebInterface:
             label = 'All Closed Bugs'
         
         if assignee != '':
-            label += ' Currently Unassigned' if assignee == 'None' else ' Assigned to %s' % (assignee,)
+            label += ' Currently Unassigned' if assignee == 'None' \
+                else ' Assigned to %s' % (assignee,)
         if target != '':
-            label += ' Currently Unschdeuled' if target == 'None' else ' Scheduled for %s' % (target,)
+            label += ' Currently Unschdeuled' if target == 'None' \
+                else ' Scheduled for %s' % (target,)
         
         template = self.env.get_template('list.html')
         bugs = self.filter_bugs(status, assignee, target)
@@ -98,6 +102,8 @@ class WebInterface:
         template = self.env.get_template('bug.html')
         common_info = self.get_common_information()
         return template.render(bug=bug, bd=self.bd, 
+                               assignee='' if bug.assigned == EMPTY else bug.assigned,
+                               target='' if bug.target == EMPTY else bug.target,
                                assignees=common_info['possible_assignees'],
                                targets=common_info['possible_targets'],
                                statuses=common_info['possible_statuses'],