[CLEAN] website_blog :code cleaning in added code
authorThibault Delavallée <tde@openerp.com>
Tue, 1 Apr 2014 09:28:26 +0000 (11:28 +0200)
committerThibault Delavallée <tde@openerp.com>
Tue, 1 Apr 2014 09:28:26 +0000 (11:28 +0200)
bzr revid: tde@openerp.com-20140401092826-gf9f365bn4wu8mk3

addons/website_blog/controllers/main.py

index aeecaaa..5229764 100644 (file)
@@ -38,8 +38,7 @@ class QueryURL(object):
         self.path_args = set(path_args or [])
 
     def __call__(self, path=None, path_args=None, **kw):
-        if not path:
-            path = self.path
+        path = path or self.path
         for k, v in self.args.items():
             kw.setdefault(k, v)
         path_args = set(path_args or []).union(self.path_args)
@@ -55,9 +54,8 @@ class QueryURL(object):
                     fragments.append(werkzeug.url_encode([(key, item) for item in value]))
                 else:
                     fragments.append(werkzeug.url_encode([(key, value)]))
-        if paths:
-            for key, value in paths:
-                path += '/' + key + '/%s' % value
+        for key, value in paths:
+            path += '/' + key + '/%s' % value
         if fragments:
             path += '?' + '&'.join(fragments)
         return path