From 9db8f8ac64c9ce3cd5e5b1610c8aaed1ffbd4364 Mon Sep 17 00:00:00 2001 From: Christophe Simonis Date: Wed, 8 Aug 2012 13:48:18 +0200 Subject: [PATCH] [FIX] remove "/mobile" hardcoded redirect bzr revid: chs@openerp.com-20120808114818-l5tpvlkxm2ylx5ym --- addons/web/common/http.py | 4 ---- addons/web_mobile/__init__.py | 1 + addons/web_mobile/controllers.py | 11 +++++++++++ 3 files changed, 12 insertions(+), 4 deletions(-) create mode 100644 addons/web_mobile/controllers.py 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)