[Mpuls-commits] r2045 - wasko/branches/2.0/mpulsweb/lib/helper

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Fri Mar 19 16:01:14 CET 2010


Author: torsten
Date: 2010-03-19 16:01:13 +0100 (Fri, 19 Mar 2010)
New Revision: 2045

Modified:
   wasko/branches/2.0/mpulsweb/lib/helper/filters.py
Log:
Fixed shorten function to work with None values.


Modified: wasko/branches/2.0/mpulsweb/lib/helper/filters.py
===================================================================
--- wasko/branches/2.0/mpulsweb/lib/helper/filters.py	2010-03-19 14:43:56 UTC (rev 2044)
+++ wasko/branches/2.0/mpulsweb/lib/helper/filters.py	2010-03-19 15:01:13 UTC (rev 2045)
@@ -45,7 +45,7 @@
 
 def shorten(text, length=40):
     shortcut = "..."
-    if len(text) > length:
+    if text and len(text) > length:
         text = text[0:length-len(shortcut)] + shortcut 
     return text
 



More information about the Mpuls-commits mailing list