[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
This commit is contained in:
@@ -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/<xmlid>',
|
||||
'/website/image/<xmlid>/<int:max_width>x<int:max_height>',
|
||||
'/website/image/<xmlid>/<field>',
|
||||
@@ -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:
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user