diff options
| author | Christophe Simonis <chs@openerp.com> | 2012-08-08 13:48:18 +0200 |
|---|---|---|
| committer | Christophe Simonis <chs@openerp.com> | 2012-08-08 13:48:18 +0200 |
| commit | 9db8f8ac64c9ce3cd5e5b1610c8aaed1ffbd4364 (patch) | |
| tree | 8a4de298ebf3a64e0f3ac2064e517cad872a2c9b /addons | |
| parent | 32dd6ddc38b96dcc7bedd4513011f47f71133e9e (diff) | |
[FIX] remove "/mobile" hardcoded redirect
bzr revid: chs@openerp.com-20120808114818-l5tpvlkxm2ylx5ym
Diffstat (limited to 'addons')
| -rw-r--r-- | addons/web/common/http.py | 4 | ||||
| -rw-r--r-- | addons/web_mobile/__init__.py | 1 | ||||
| -rw-r--r-- | addons/web_mobile/controllers.py | 11 |
3 files changed, 12 insertions, 4 deletions
diff --git a/addons/web/common/http.py b/addons/web/common/http.py index 9debaa7bcb9..6b1a28e5803 100644 --- a/addons/web/common/http.py +++ b/addons/web/common/http.py @@ -494,10 +494,6 @@ class Root(object): request.parameter_storage_class = werkzeug.datastructures.ImmutableDict request.app = self - if request.path == '/mobile': # FIXME move to web_mobile module - return werkzeug.utils.redirect( - '/web_mobile/static/src/web_mobile.html', 301)(environ, start_response) - handler = self.find_handler(*(request.path.split('/')[1:])) if not handler: diff --git a/addons/web_mobile/__init__.py b/addons/web_mobile/__init__.py index e69de29bb2d..ee5959455ad 100644 --- a/addons/web_mobile/__init__.py +++ b/addons/web_mobile/__init__.py @@ -0,0 +1 @@ +import controllers diff --git a/addons/web_mobile/controllers.py b/addons/web_mobile/controllers.py new file mode 100644 index 00000000000..2b12a178c15 --- /dev/null +++ b/addons/web_mobile/controllers.py @@ -0,0 +1,11 @@ +#!/usr/bin/env python + +from openerp.addons.web.common import http as oeweb +import werkzeug + +class Mobile(oeweb.Controller): + _cp_path = '/mobile' + + @oeweb.httprequest + def index(self, req): + return werkzeug.utils.redirect('/web_mobile/static/src/web_mobile.html', 301) |
