[web] cleanup xmlrss view
authorJulien Cristau <julien.cristau@logilab.fr>
Thu, 19 Mar 2015 21:19:52 +0100
changeset 11247 518eb10adcd5
parent 11246 ceb0e8e9129e
child 11248 b288debc6736
[web] cleanup xmlrss view Don't trigger exceptions unnecessarily, and add line breaks to the output.
cubicweb/web/views/xmlrss.py
--- a/cubicweb/web/views/xmlrss.py	Wed Feb 17 14:01:35 2016 +0100
+++ b/cubicweb/web/views/xmlrss.py	Thu Mar 19 21:19:52 2015 +0100
@@ -94,10 +94,8 @@
             if value is None:
                 self.w(u'  <%s/>\n' % attr)
             else:
-                try:
+                if attrschema in SERIALIZERS:
                     value = SERIALIZERS[attrschema](value)
-                except KeyError:
-                    pass
                 self.w(u'  <%s>%s</%s>\n' % (attr, value, attr))
         for relstr in self._cw.list_form_param('relation'):
             try:
@@ -175,7 +173,7 @@
                     val = self._cw.view('final', rset, row=rowindex,
                                         col=colindex, format='text/plain')
                 w(simple_sgml_tag(tag, val, **attrs))
-            w(u' </row>\n')
+            w(u'\n </row>\n')
         w(u'</%s>\n' % self.xml_root)