Only sitemap events that actually are renderable
authorMagnus Hagander <magnus@hagander.net>
Tue, 12 Jul 2011 13:17:14 +0000 (14:17 +0100)
committerMagnus Hagander <magnus@hagander.net>
Tue, 12 Jul 2011 13:17:14 +0000 (14:17 +0100)
pgweb/events/struct.py

index 7338e9715a9f8ccd393f6067276076f7665584a4..e6da17aae9038d484625f295bf68c146841f18bb 100644 (file)
@@ -7,8 +7,10 @@ def get_struct():
 
        # We intentionally don't put /about/eventarchive/ in the sitemap,
        # since we don't care about getting it indexed.
+       # We only show events in the future, so only index events in the
+       # future...
 
-       for n in Event.objects.filter(approved=True):
+       for n in Event.objects.filter(approved=True, enddate__gt=date.today):
                yearsold = (now - n.startdate).days / 365
                if yearsold > 4:
                        yearsold = 4