diff src/server/blog.py @ 886:fe4d8dfaaa65

blog: OK, OK, I forgot the _quote method, it's better now :)
author Goffi <goffi@goffi.org>
date Wed, 09 Mar 2016 21:58:05 +0100
parents 12e0bfdfe9c6
children dd2273617eb7
line wrap: on
line diff
--- a/src/server/blog.py	Wed Mar 09 21:21:15 2016 +0100
+++ b/src/server/blog.py	Wed Mar 09 21:58:05 2016 +0100
@@ -430,7 +430,7 @@
             link_blog_elt['type'] = u'application/xmpp+xml'
             link_blog_elt['href'] = blog_xmpp_uri
 
-            feed_elt.addElement('id', content=urllib.quote(blog_xmpp_uri.encode('utf-8')))
+            feed_elt.addElement('id', content=_quote(blog_xmpp_uri))
             updated_unix = max([float(item['updated']) for item in items])
             updated_dt = datetime.fromtimestamp(updated_unix)
             feed_elt.addElement(u'updated', u'{}Z'.format(updated_dt.isoformat("T")))
@@ -450,7 +450,7 @@
                 http_link_elt = entry_elt.addElement(u'link')
                 http_link_elt['rel'] = u'alternate'
                 http_link_elt['type'] = u'text/html'
-                http_link_elt['href'] = u'{base}/{quoted_id}'.format(base=base_blog_url, quoted_id=urllib.quote(item['id'].encode('utf-8')))
+                http_link_elt['href'] = u'{base}/{quoted_id}'.format(base=base_blog_url, quoted_id=_quote(item['id']))
                 # XMPP link
                 xmpp_link_elt = entry_elt.addElement(u'link')
                 xmpp_link_elt['rel'] = u'alternate'
@@ -574,7 +574,7 @@
             # FIXME: that's really not a good way to get item id
             #        this must be changed after static blog refactorisation
             item_id = items[0][0]['id']
-            xmpp_uri+=u";item={}".format(urllib.quote(item_id.encode('utf-8')))
+            xmpp_uri+=u";item={}".format(_quote(item_id))
 
         data = {'url_base': base_url,
                 'xmpp_uri': xmpp_uri,