]> git.parisson.com Git - teleforma.git/commitdiff
fix no space in answers
authorGuillaume Pellerin <yomguy@parisson.com>
Mon, 17 Jun 2013 16:03:59 +0000 (18:03 +0200)
committerGuillaume Pellerin <yomguy@parisson.com>
Mon, 17 Jun 2013 16:03:59 +0000 (18:03 +0200)
teleforma/templatetags/teleforma_tags.py

index c5f70ae4f8037462edb09a742192d0b49febfcce..2bdfb4d1a5a2e33515f0e3b3709a8547c3b80219 100644 (file)
@@ -243,7 +243,10 @@ def validated(question, user):
 
 @register.filter
 def summary(text, N):
-    return text[:N] + '...'
+    t = text[:N]
+    if not ' ' in t:
+        t = text[:N/2]
+    return t + '...'
 
 @register.filter
 def progress(seminar, user):