From 6207644c00fc9ffe6a17e236b0df351fc456fda3 Mon Sep 17 00:00:00 2001 From: Denis Ledoux Date: Tue, 22 Mar 2016 17:53:25 +0100 Subject: [PATCH] [FIX] website*: remove technical routes in sitemap Multiple technical routes were listed in the sitemap, and it's pointless to list them in the sitemap. There is currently no way to exclude routes from the sitemap using a specifc argument (e.g. sitemap=False on the route). Therefore, in order to remove them from the sitemap, we play with the current conditions to exclude these routes from the sitemap: - routes with `auth` other than `none` and 'public` are excluded. Technical routes marked as `auth="public"` for no reasons are changed to `auth="user" so they are excluded from the sitemap - routes with required arguments are excluded as well. the route `website/image` cannot work without any argument, `website/image` has therefore been removed from the possible routes for the method `website_image`, so it's no longer listed in the sitemap. For an exhaustive list of the conditions to exclude a route from the sitemap, check the method `rule_is_enumerable` in `website/models/website.py` opw-670865 --- addons/website/controllers/main.py | 3 +-- addons/website_mail/controllers/email_designer.py | 4 ++-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/addons/website/controllers/main.py b/addons/website/controllers/main.py index 9ef28bcba77..0443ac03e68 100644 --- a/addons/website/controllers/main.py +++ b/addons/website/controllers/main.py @@ -433,7 +433,6 @@ class Website(openerp.addons.web.controllers.main.Home): return request.registry['website']._image_placeholder(response) @http.route([ - '/website/image', '/website/image/', '/website/image//x', '/website/image//', @@ -528,7 +527,7 @@ class Website(openerp.addons.web.controllers.main.Home): #------------------------------------------------------ # Backend html field #------------------------------------------------------ - @http.route('/website/field/html', type='http', auth="public", website=True) + @http.route('/website/field/html', type='http', auth="user", website=True) def FieldTextHtml(self, model=None, res_id=None, field=None, callback=None, **kwargs): record = None if model and res_id: diff --git a/addons/website_mail/controllers/email_designer.py b/addons/website_mail/controllers/email_designer.py index 16ef40095a5..f7ac12ade0c 100644 --- a/addons/website_mail/controllers/email_designer.py +++ b/addons/website_mail/controllers/email_designer.py @@ -82,12 +82,12 @@ class Website(addons.website.controllers.main.Website): #------------------------------------------------------ # Backend email template field #------------------------------------------------------ - @http.route('/website_mail/field/email', type='http', auth="public", website=True) + @http.route('/website_mail/field/email', type='http', auth="user", website=True) def FieldTextHtmlEmail(self, model=None, res_id=None, field=None, callback=None, **kwargs): kwargs['template'] = "website_mail.FieldTextHtmlEmail" return self.FieldTextHtml(model, res_id, field, callback, **kwargs) - @http.route('/website_mail/field/email_template', type='http', auth="public", website=True) + @http.route('/website_mail/field/email_template', type='http', auth="user", website=True) def FieldTextHtmlEmailTemplate(self, model=None, res_id=None, field=None, callback=None, **kwargs): cr, uid, context = request.cr, request.uid, request.context kwargs['theme'] = True