summaryrefslogtreecommitdiff
path: root/addons
diff options
context:
space:
mode:
authorChristophe Simonis <chs@openerp.com>2012-08-08 13:48:18 +0200
committerChristophe Simonis <chs@openerp.com>2012-08-08 13:48:18 +0200
commit9db8f8ac64c9ce3cd5e5b1610c8aaed1ffbd4364 (patch)
tree8a4de298ebf3a64e0f3ac2064e517cad872a2c9b /addons
parent32dd6ddc38b96dcc7bedd4513011f47f71133e9e (diff)
[FIX] remove "/mobile" hardcoded redirect
bzr revid: chs@openerp.com-20120808114818-l5tpvlkxm2ylx5ym
Diffstat (limited to 'addons')
-rw-r--r--addons/web/common/http.py4
-rw-r--r--addons/web_mobile/__init__.py1
-rw-r--r--addons/web_mobile/controllers.py11
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)