summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristophe Simonis <chs@odoo.com>2014-12-12 19:34:10 +0100
committerChristophe Simonis <chs@odoo.com>2014-12-12 19:34:31 +0100
commit44e401c983d47a84487ff38505f729b3affc5bcd (patch)
tree71656f7b6443d2d2661170059a11f7fc2c55ee64
parent4e617069a34177292ea8f7d992e62b65c0450fab (diff)
[IMP] http.py: allow @route decorator to pass extra arguments to created werkzeug.routing.Rule
-rw-r--r--openerp/http.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/openerp/http.py b/openerp/http.py
index f25d77fa3a7..4a4aac9a7db 100644
--- a/openerp/http.py
+++ b/openerp/http.py
@@ -803,7 +803,9 @@ def routing_map(modules, nodb_only, converters=None):
if url.endswith("/") and len(url) > 1:
url = url[: -1]
- routing_map.add(werkzeug.routing.Rule(url, endpoint=endpoint, methods=routing['methods']))
+ xtra_keys = 'defaults subdomain build_only strict_slashes redirect_to alias host'.split()
+ kw = {k: routing[k] for k in xtra_keys if k in routing}
+ routing_map.add(werkzeug.routing.Rule(url, endpoint=endpoint, methods=routing['methods'], **kw))
return routing_map
#----------------------------------------------------------