From 3652f90e610a786092236ab6e7ca8b3af3d58248 Mon Sep 17 00:00:00 2001 From: Jeremy Kersten Date: Fri, 1 Dec 2023 11:41:32 +0100 Subject: [PATCH] [FIX] mail_group: don't pollute sitemap Controller /groups/ is already in the sitemap, so it is useless to list all messages. It will explode the sitemap, for pages that don't need to be really indexed. What we want is the thread, not one page by message. And since no domain was set on domainConverter, the most of urls are just 404. e.g. groupA with msg1/msg2 and groupB by with msg3/msg4 will generate: groupA/msg1 groupA/msg2 groupA/msg3 groupA/msg4 groupB/msg1 groupB/msg2 groupB/msg3 groupB/msg4 instead of groupA/msg1 groupA/msg2 groupB/msg3 groupB/msg4 If we really wanted to index this route, then the domainConverter would have to be: ```py '''/groups// --- addons/mail_group/controllers/portal.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/mail_group/controllers/portal.py b/addons/mail_group/controllers/portal.py index 3c4b60de67a..456391ded1a 100644 --- a/addons/mail_group/controllers/portal.py +++ b/addons/mail_group/controllers/portal.py @@ -141,7 +141,7 @@ class PortalMailGroup(http.Controller): }) @http.route('/groups//', - type='http', auth='public', sitemap=True, website=True) + type='http', auth='public', sitemap=False, website=True) def group_view_message(self, group, message, mode='thread', date_begin=None, date_end=None, **post): if group != message.mail_group_id: raise werkzeug.exceptions.NotFound()