[logs table view] only put values starting with http in <a> tag stable
authorSylvain Thénault <sylvain.thenault@logilab.fr>
Tue, 15 May 2012 14:43:08 +0200
branchstable
changeset 8405 e83725261adf
parent 8403 a6ee3cd783e1
child 8406 f3bc8ca0b715
[logs table view] only put values starting with http in <a> tag
web/views/cwsources.py
--- a/web/views/cwsources.py	Tue May 15 10:36:02 2012 +0200
+++ b/web/views/cwsources.py	Tue May 15 14:43:08 2012 +0200
@@ -421,7 +421,9 @@
     class URLRenderer(pyviews.PyValTableColRenderer):
         def render_cell(self, w, rownum):
             url = self.data[rownum][1]
-            w(url and tags.a(url, href=url) or u'&#160;')
+            if url and url.startswith('http'):
+                url = tags.a(url, href=url)
+            w(url or u'&#160;')
 
     class LineRenderer(pyviews.PyValTableColRenderer):
         def render_cell(self, w, rownum):