changeset 371:8b44243b799a

Fix setting workpackage of project if description is None
author Björn Ricks <bjoern.ricks@intevation.de>
date Fri, 07 Mar 2014 16:02:07 +0100
parents f4dcfbede99b
children a805aaed97dd
files getan/project.py
diffstat 1 files changed, 7 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/getan/project.py	Mon Mar 03 15:57:54 2014 +0100
+++ b/getan/project.py	Fri Mar 07 16:02:07 2014 +0100
@@ -90,6 +90,7 @@
         self.start = start
         self.end = end
         self.desc = desc
+        self.workpackage = "-"
 
         # carefully handle non unicode string
         # urwid seems to have some issue with plain str
@@ -97,13 +98,12 @@
             self.desc = unicode(self.desc, locale.getpreferredencoding())
 
         c = self.desc
-        m = self.WORKPACKAGE.match(c)
-        if m:
-            self.workpackage = m.group(1)
-            c = c[m.end():].strip()
-        else:
-            self.workpackage = "-"
-        c = c.replace('\x1b', '')
+        if c:
+            m = self.WORKPACKAGE.match(c)
+            if m:
+                self.workpackage = m.group(1)
+                c = c[m.end():].strip()
+            c = c.replace('\x1b', '')
         self.comment = c
 
     def get_workpackage(self):
This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)