[FIX] website: fix sitemap to avoid to get post route inside
Route with method="['POST']" should not appear in sitemap This code had never works. rule.method is not the list of methods declared on the endpoint but "the HTTP method for the rule if there are different URLs for different methods on the same endpoint" (src http://werkzeug.pocoo.org/docs/0.11/routing/) The new code uses the method declared on endpoint and so will avoid to add endpoint with method declared and wich doesn't support GET.
This commit is contained in:
parent
148c1ed51c
commit
33e84a6622
|
@ -347,7 +347,8 @@ class website(osv.osv):
|
|||
:rtype: bool
|
||||
"""
|
||||
endpoint = rule.endpoint
|
||||
methods = rule.methods or ['GET']
|
||||
methods = endpoint.routing.get('method') or ['GET']
|
||||
|
||||
converters = rule._converters.values()
|
||||
if not ('GET' in methods
|
||||
and endpoint.routing['type'] == 'http'
|
||||
|
|
Loading…
Reference in New Issue