summaryrefslogtreecommitdiff
path: root/addons/website
diff options
context:
space:
mode:
authorXavier Morel <xmo@openerp.com>2013-07-24 10:59:21 +0200
committerXavier Morel <xmo@openerp.com>2013-07-24 10:59:21 +0200
commit7eb03e5a46f558f10a41b672d6a3fa76ff1d7abb (patch)
tree4937c6f52780537260a5fb2e6abd594b05e17397 /addons/website
parent5fc0d839eed26fb5beca4333105465736b30d74e (diff)
[IMP] manual urllib.quote_plus -> bulk urllib.urlencode
bzr revid: xmo@openerp.com-20130724085921-tc6mnnb2a4g4jmvu
Diffstat (limited to 'addons/website')
-rw-r--r--addons/website/controllers/main.py19
1 files changed, 12 insertions, 7 deletions
diff --git a/addons/website/controllers/main.py b/addons/website/controllers/main.py
index 925dcf737f3..744bfde64d9 100644
--- a/addons/website/controllers/main.py
+++ b/addons/website/controllers/main.py
@@ -1,8 +1,9 @@
# -*- coding: utf-8 -*-
+import urllib
+
import openerp
from openerp.addons.web import http
from openerp.addons.web.controllers.main import manifest_list
-from urllib import quote_plus
from openerp.addons.web.http import request
def template_values():
@@ -68,12 +69,16 @@ class Website(openerp.addons.web.controllers.main.Home):
'inherit_branding': values['editable'],
}
company = request.registry['res.company'].browse(request.cr, uid, 1, context=context)
- values.update({
- 'res_company': company,
- 'path': path
- })
- values['google_map_url'] = "http://maps.googleapis.com/maps/api/staticmap?center=%s&sensor=false&zoom=8&size=298x298" \
- % quote_plus('%s, %s %s, %s' % (company.street, company.city, company.zip, company.country_id and company.country_id.name_get()[0][1] or ''))
+ values.update(
+ res_company=company,
+ path=path,
+ google_map_url="http://maps.googleapis.com/maps/api/staticmap?" + urllib.urlencode({
+ 'center': '%s, %s %s, %s' % (company.street, company.city, company.zip, company.country_id and company.country_id.name_get()[0][1] or ''),
+ 'sensor': 'false',
+ 'zoom': '8',
+ 'size': '298x298',
+ }),
+ )
try:
html = request.registry.get("ir.ui.view").render(request.cr, uid, path, values, context)
except ValueError, e: