[Mpuls-commits] r4358 - in base/trunk: . mpulsweb/lib mpulsweb/lib/helper

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Mon Dec 13 11:29:05 CET 2010


Author: roland
Date: 2010-12-13 11:29:04 +0100 (Mon, 13 Dec 2010)
New Revision: 4358

Modified:
   base/trunk/ChangeLog
   base/trunk/mpulsweb/lib/helper/filters.py
   base/trunk/mpulsweb/lib/helpers.py
Log:
issue1550: fix in function convertForDigest

Modified: base/trunk/ChangeLog
===================================================================
--- base/trunk/ChangeLog	2010-12-13 10:28:29 UTC (rev 4357)
+++ base/trunk/ChangeLog	2010-12-13 10:29:04 UTC (rev 4358)
@@ -1,3 +1,9 @@
+2010-12-13  Roland Geider <roland.geider at intevation.de>
+	 
+	 * mpulsweb/lib/helper/filters.py,
+	   mpulsweb/lib/helpers.py: issue1550: fix in function convertForDigest
+	   that resulted in an exception for mysterious reasons
+
 2010-12-09  Torsten Irlaender <torsten at intevation.de>
 
 	* mpulsweb/lib/helpers.py (timedelta_in_years), (get_age): Issue821: Added new

Modified: base/trunk/mpulsweb/lib/helper/filters.py
===================================================================
--- base/trunk/mpulsweb/lib/helper/filters.py	2010-12-13 10:28:29 UTC (rev 4357)
+++ base/trunk/mpulsweb/lib/helper/filters.py	2010-12-13 10:29:04 UTC (rev 4358)
@@ -55,9 +55,10 @@
 
 def nl_to_br(text):
     """Replace newlines in text with <br> tags"""
-    text = text.replace('\r\n', '<br>')
-    text = text.replace('\n', '<br>')
-    text = text.replace('\r', '<br>')
+    if text:
+       text = text.replace('\r\n', '<br>')
+       text = text.replace('\n', '<br>')
+       text = text.replace('\r', '<br>')
     return text
 
 # vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8:

Modified: base/trunk/mpulsweb/lib/helpers.py
===================================================================
--- base/trunk/mpulsweb/lib/helpers.py	2010-12-13 10:28:29 UTC (rev 4357)
+++ base/trunk/mpulsweb/lib/helpers.py	2010-12-13 10:29:04 UTC (rev 4358)
@@ -155,6 +155,8 @@
     if isinstance(value, int):
         if value == -9999999:
             return _('unknown')  
+    if value == None:
+        return ""
     return value
 
 # Helper functions used in the UI to show some information like status messages



More information about the Mpuls-commits mailing list