diff options
Diffstat (limited to 'addons/website')
| -rw-r--r-- | addons/website/i18n/zh_CN.po | 12 | ||||
| -rw-r--r-- | addons/website/models/ir_http.py | 15 |
2 files changed, 14 insertions, 13 deletions
diff --git a/addons/website/i18n/zh_CN.po b/addons/website/i18n/zh_CN.po index fdc5be757f0..ccc60056af5 100644 --- a/addons/website/i18n/zh_CN.po +++ b/addons/website/i18n/zh_CN.po @@ -6,9 +6,9 @@ # Jeffery CHEN Fan <jeffery9@gmail.com>, 2016 # Talway <9010446@qq.com>, 2016 # niulin lnc. <admin@niulin.net>, 2016 -# fausthuang <faust_huang@hotmail.com>, 2016 +# fausthuang, 2016 # waveyeung <waveyeung@qq.com>, 2016 -# Martin Trigaux <mat@odoo.com>, 2016 +# Martin Trigaux, 2016 # Maie <m@maie.name>, 2016 # 菜小蛇 <lttlsnk@gmail.com>, 2016 # xiaobin wu <bd5dml@gmail.com>, 2016 @@ -21,7 +21,7 @@ # Wei "oldrev" Li <liwei@sandwych.com>, 2016 # SHOM <shanmuxin@yeah.net>, 2016 # 苏州远鼎 <tiexinliu@126.com>, 2016 -# Bo Cao <cao.poobo@hotmail.com>, 2017 +# Bo Cao, 2017 # Liping Wang <lynn.config@gmail.com>, 2017 # Jeff Yu - Elico Corp <jeff.yu@elico-corp.com>, 2017 # 老窦 北京 <2662059195@qq.com>, 2017 @@ -111,6 +111,8 @@ msgid "" ",\n" " the #1" msgstr "" +",\n" +"此 #1" #. module: website #: model:ir.ui.view,arch_db:website.show_website_info @@ -143,7 +145,7 @@ msgstr "" #. module: website #: model:ir.ui.view,arch_db:website.default_csv msgid "1,2,3" -msgstr "" +msgstr "1,2,3" #. module: website #: model:ir.ui.view,arch_db:website.snippet_options @@ -286,7 +288,7 @@ msgstr "<i class=\"fa fa-clock-o\"/>幻灯片播放速度" #. module: website #: model:ir.ui.view,arch_db:website.snippets msgid "<i class=\"fa fa-diamond\"/> Feature" -msgstr "" +msgstr "特征" #. module: website #: model:ir.ui.view,arch_db:website.snippet_options diff --git a/addons/website/models/ir_http.py b/addons/website/models/ir_http.py index 84813d7eca5..c87d7226893 100644 --- a/addons/website/models/ir_http.py +++ b/addons/website/models/ir_http.py @@ -124,12 +124,6 @@ class Http(models.AbstractModel): return False @classmethod - def _serve_404(cls): - req_page = request.httprequest.path - page404 = 'website.%s' % (request.website.is_publisher() and 'page_404' or '404') - return request.render(page404, {'path': req_page[1:]}) - - @classmethod def _serve_redirect(cls): req_page = request.httprequest.path domain = [ @@ -153,7 +147,7 @@ class Http(models.AbstractModel): if redirect: return request.redirect(redirect.url_to, code=redirect.type) - return cls._serve_404() + return False @classmethod def _handle_exception(cls, exception): @@ -212,11 +206,16 @@ class Http(models.AbstractModel): status_code=code, ) + view_id = code + if request.website.is_publisher() and isinstance(exception, werkzeug.exceptions.NotFound): + view_id = 'page_404' + values['path'] = request.httprequest.path[1:] + if not request.uid: cls._auth_method_public() try: - html = request.env['ir.ui.view'].render_template('website.%s' % code, values) + html = request.env['ir.ui.view'].render_template('website.%s' % view_id, values) except Exception: html = request.env['ir.ui.view'].render_template('website.http_error', values) return werkzeug.wrappers.Response(html, status=code, content_type='text/html;charset=utf-8') |
