[web] req.lang should be None or a non-empty string 3.24
authorSylvain Thénault <sylvain.thenault@logilab.fr>
Thu, 10 Nov 2016 18:23:45 +0100
branch3.24
changeset 11826 e2c940c8c485
parent 11825 52acf0dbf4cd
child 11827 851b6bd79b50
[web] req.lang should be None or a non-empty string
cubicweb/web/request.py
--- a/cubicweb/web/request.py	Thu Nov 17 10:15:11 2016 +0100
+++ b/cubicweb/web/request.py	Thu Nov 10 18:23:45 2016 +0100
@@ -663,7 +663,7 @@
     def build_url_path(self, *args):
         path = super(_CubicWebRequestBase, self).build_url_path(*args)
         lang_prefix = ''
-        if self.lang and self.vreg.config.get('language-mode') == 'url-prefix':
+        if self.lang is not None and self.vreg.config.get('language-mode') == 'url-prefix':
             lang_prefix = '%s/' % self.lang
         return lang_prefix + path