[MERGE] forward port of branch 8.0 up to 2b192be
[odoo/odoo.git] / addons / website / models / ir_http.py
index 7baa5ea..44f9dca 100644 (file)
@@ -65,7 +65,7 @@ class ir_http(orm.AbstractModel):
                     import GeoIP
                     # updated database can be downloaded on MaxMind website
                     # http://dev.maxmind.com/geoip/legacy/install/city/
-                    geofile = config.get('geoip_database', '/usr/share/GeoIP/GeoLiteCity.dat')
+                    geofile = config.get('geoip_database')
                     if os.path.exists(geofile):
                         self.geo_ip_resolver = GeoIP.open(geofile, GeoIP.GEOIP_STANDARD)
                     else:
@@ -123,6 +123,8 @@ class ir_http(orm.AbstractModel):
                         # to url without language so google doesn't see duplicate content
                         return request.redirect(path + '?' + request.httprequest.query_string, code=301)
                     return self.reroute(path)
+            # bind modified context
+            request.website = request.website.with_context(request.context)
         return super(ir_http, self)._dispatch()
 
     def reroute(self, path):