[MERGE] Forward-port of saas-4 up to fa739ac
authorOlivier Dony <odo@openerp.com>
Wed, 25 Jun 2014 16:44:51 +0000 (18:44 +0200)
committerOlivier Dony <odo@openerp.com>
Wed, 25 Jun 2014 16:44:51 +0000 (18:44 +0200)
1  2 
addons/website/models/ir_http.py
addons/website_forum/controllers/main.py
openerp/http.py

@@@ -69,12 -60,7 +69,11 @@@ class ir_http(orm.AbstractModel)
                  if path[1] in langs:
                      request.lang = request.context['lang'] = path.pop(1)
                      path = '/'.join(path) or '/'
 +                    if request.lang == request.website.default_lang_code:
 +                        # If language is in the url and it is the default language, redirect
 +                        # to url without language so google doesn't see duplicate content
 +                        return request.redirect(path + '?' + request.httprequest.query_string)
                      return self.reroute(path)
-                 return self._handle_exception(code=404)
          return super(ir_http, self)._dispatch()
  
      def reroute(self, path):
@@@ -208,7 -208,7 +208,7 @@@ class WebsiteForum(http.Controller)
              }, context=context)
          return werkzeug.utils.redirect("/forum/%s/question/%s" % (slug(forum), new_question_id))
  
-     @http.route(['''/forum/<model("forum.forum"):forum>/question/<model("forum.post", "[('forum_id','=',forum[0])]"):question>'''], type='http', auth="public", website=True)
 -    @http.route(['''/forum/<model("forum.forum"):forum>/question/<model("forum.post", "[('forum_id','=',forum[0]),('parent_id','=',False)]"):question>'''], type='http', auth="public", website=True, multilang=True)
++    @http.route(['''/forum/<model("forum.forum"):forum>/question/<model("forum.post", "[('forum_id','=',forum[0]),('parent_id','=',False)]"):question>'''], type='http', auth="public", website=True)
      def question(self, forum, question, **post):
          cr, uid, context = request.cr, request.uid, request.context
          # increment view counter
diff --cc openerp/http.py
Simple merge