Fix Bug.string() handling of None times.
authorW. Trevor King <wking@drexel.edu>
Sun, 16 Nov 2008 19:32:19 +0000 (14:32 -0500)
committerW. Trevor King <wking@drexel.edu>
Sun, 16 Nov 2008 19:32:19 +0000 (14:32 -0500)
libbe/bug.py

index a0054caac95ed4b1dec20ab89e5a7794e97ec688..f973cf087c4adf3c227e4fe6e510012a734cdf40 100644 (file)
@@ -118,8 +118,12 @@ class Bug(object):
             bugs = list(self.bugdir.list())
         short_name = names.unique_name(self, bugs)
         if shortlist == False:
-            htime = utility.handy_time(self.time)
-            ftime = utility.time_to_str(self.time)
+            if self.time == None:
+                timestring = ""
+            else:
+                htime = utility.handy_time(self.time)
+                ftime = utility.time_to_str(self.time)
+                timestring = "%s (%s)" % (htime, ftime)
             info = [("ID", self.uuid),
                     ("Short name", short_name),
                     ("Severity", self.severity),
@@ -127,7 +131,7 @@ class Bug(object):
                     ("Assigned", self.assigned),
                     ("Target", self.target),
                     ("Creator", self.creator),
-                    ("Created", "%s (%s)" % (htime, ftime))]
+                    ("Created", timestring)]
             newinfo = []
             for k,v in info:
                 if v == None: