From 9d4ae83260679386bf458fefddeb1789b494d643 Mon Sep 17 00:00:00 2001 From: Bo Lopker Date: Tue, 7 Jan 2025 17:00:47 -0800 Subject: [PATCH] Fix TOT-234: Only show upcoming spaces in sitemap --- totem/circles/urls.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/totem/circles/urls.py b/totem/circles/urls.py index 4132e1f..94aeccd 100644 --- a/totem/circles/urls.py +++ b/totem/circles/urls.py @@ -1,5 +1,6 @@ from django.contrib.sitemaps import Sitemap from django.urls import path +from django.utils import timezone from . import views from .models import CircleEvent @@ -12,7 +13,9 @@ class SpacesSitemap(Sitemap): changefreq = "daily" def items(self): - return CircleEvent.objects.filter(cancelled=False, open=True, listed=True, circle__published=True) + return CircleEvent.objects.filter( + start__gte=timezone.now(), cancelled=False, open=True, listed=True, circle__published=True + ) def lastmod(self, obj: CircleEvent): return obj.date_modified