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

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Tue Dec 14 09:28:33 CET 2010


Author: roland
Date: 2010-12-14 09:28:32 +0100 (Tue, 14 Dec 2010)
New Revision: 4366

Modified:
   base/trunk/ChangeLog
   base/trunk/mpulsweb/lib/helper/filters.py
Log:
only attempt to convert new lines to <br> for strings

Modified: base/trunk/ChangeLog
===================================================================
--- base/trunk/ChangeLog	2010-12-13 16:05:30 UTC (rev 4365)
+++ base/trunk/ChangeLog	2010-12-14 08:28:32 UTC (rev 4366)
@@ -1,3 +1,8 @@
+2010-12-13  Roland Geider <roland.geider at intevation.de>
+
+	* mpulsweb/lib/helper/filters.py: only attempt to convert new lines to
+	  <br> for strings
+
 2010-12-13  Bernhard Herzog  <bh at intevation.de>
 
 	* mpulsweb/model/logbook.py (get_logbook_import_factory): Adapt to

Modified: base/trunk/mpulsweb/lib/helper/filters.py
===================================================================
--- base/trunk/mpulsweb/lib/helper/filters.py	2010-12-13 16:05:30 UTC (rev 4365)
+++ base/trunk/mpulsweb/lib/helper/filters.py	2010-12-14 08:28:32 UTC (rev 4366)
@@ -55,7 +55,7 @@
 
 def nl_to_br(text):
     """Replace newlines in text with <br> tags"""
-    if text:
+    if isinstance(text, basestring):
        text = text.replace('\r\n', '<br>')
        text = text.replace('\n', '<br>')
        text = text.replace('\r', '<br>')



More information about the Mpuls-commits mailing list