From 783502cfb951c33a0a4037296ce3734b34e22fea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Chlo=C3=A9?= Date: Thu, 3 Oct 2024 15:51:10 +0200 Subject: [PATCH] =?UTF-8?q?Sauts=20de=20ligne=20et=20fix=20d'un=20bloc=20c?= =?UTF-8?q?ontenant=20un=20op=C3=A9rateur=20logique?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lemarche/www/pages/sitemaps.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/lemarche/www/pages/sitemaps.py b/lemarche/www/pages/sitemaps.py index 27132089e..8730d2624 100644 --- a/lemarche/www/pages/sitemaps.py +++ b/lemarche/www/pages/sitemaps.py @@ -8,9 +8,11 @@ "2021-10-06-le-marche-fait-peau-neuve", ] + class FlatPageSitemap(Sitemap): changefreq = "monthly" priority = 0.6 + def items(self): return Page.objects.all() @@ -24,6 +26,7 @@ def location(self, obj): class StaticPageSitemap(Sitemap): changefreq = "yearly" priority = 0.4 + def _is_included_view(self, callback): """ Check if a view has to be included in the sitemap. @@ -36,8 +39,9 @@ def _is_included_view(self, callback): HomeView, PageView, or SitemapView, False otherwise. """ return ( - hasattr(callback, 'view_class') and - issubclass(callback.view_class, (ContactView, PageView, SitemapView)) + hasattr(callback, 'view_class') and issubclass( + callback.view_class, (ContactView, PageView, SitemapView) + ) ) def items(self):