[FIX] case where Root's dispatcher finds a non-exposed method

Using elif, if a method was found but not exposed (because
internal/whatever) the controller's index method would be skipped
during URL dispatch leading to a 404.

Since matched method yields an early return, a simple if will work,
and will *not* skip case where ``method and not method.exposed``

bzr revid: xmo@openerp.com-20130507081611-t2bfba2ai79xj1ew
This commit is contained in:
Xavier Morel 2013-05-07 10:16:11 +02:00
parent 3baa897ec2
commit 7743760a4f
1 changed files with 1 additions and 1 deletions

View File

@ -614,7 +614,7 @@ class Root(object):
elif exposed == 'http':
_logger.debug("Dispatch http to %s %s %s", ps, c, method_name)
return lambda request: HttpRequest(request).dispatch(method)
elif method_name != "index":
if method_name != "index":
method_name = "index"
continue
ps, _slash, method_name = ps.rpartition('/')