Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/develop' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
JasonLovesDoggo committed Jan 3, 2024
2 parents 0ab1b82 + 776497a commit 6b78d33
Showing 1 changed file with 1 addition and 18 deletions.
19 changes: 1 addition & 18 deletions core/utils/sitemaps.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from django.contrib.flatpages.models import FlatPage
from django.contrib.sitemaps import Sitemap, ping_google
from django.contrib.sitemaps import Sitemap

from core.models import *

Expand Down Expand Up @@ -38,20 +38,3 @@ class FlatpagesSitemap(Sitemap):

def items(self):
return FlatPage.objects.all()


@receiver(post_save, sender=BlogPost)
@receiver(post_save, sender=Announcement)
@receiver(post_save, sender=Organization)
def ping_sitemap_watchers(sender, instance, created, raw, update_fields, **kwargs):
if settings.DEBUG:
return
if not created:
return
try:
ping_google(sitemap_url="/sitemap.xml")
except Exception:
print("Could not ping Google.")
# Bare 'except' because we could get a variety
# of HTTP-related exceptions.
pass

0 comments on commit 6b78d33

Please sign in to comment.