Skip to content

Commit

Permalink
Fix TOT-234: Only show upcoming spaces in sitemap
Browse files Browse the repository at this point in the history
  • Loading branch information
blopker committed Jan 8, 2025
1 parent 3a2f848 commit 9d4ae83
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion totem/circles/urls.py
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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
Expand Down

0 comments on commit 9d4ae83

Please sign in to comment.