From c5a02bd08ed75a14c28f12ae965c26b4006aa5d6 Mon Sep 17 00:00:00 2001 From: sarahframe Date: Thu, 20 Jun 2024 13:20:00 +1200 Subject: [PATCH] remove get_url_parts --- cdhweb/blog/models.py | 19 ------------------- 1 file changed, 19 deletions(-) diff --git a/cdhweb/blog/models.py b/cdhweb/blog/models.py index 0304f97a..e4592e05 100644 --- a/cdhweb/blog/models.py +++ b/cdhweb/blog/models.py @@ -186,25 +186,6 @@ def author_list(self): """Comma-separated list of author names.""" return ", ".join(str(author.person) for author in self.authors.all()) - def get_url_parts(self, *args, **kwargs): - """Custom blog post URLs of the form /updates/2014/03/01/my-post.""" - url_parts = super().get_url_parts(*args, **kwargs) - # NOTE evidently these can sometimes be None; unclear why – perhaps it - # gets called in a context where the request is unavailable. Seems to - # happen immediately on page creation; the creation still succeeds. - if url_parts and self.first_published_at: - site_id, root_url, _ = url_parts - page_path = reverse( - "blog:detail", - kwargs={ - "year": self.first_published_at.year, - # force two-digit month and day - "month": "%02d" % self.first_published_at.month, - "day": "%02d" % self.first_published_at.day, - "slug": self.slug, - }, - ) - return site_id, root_url, page_path def get_sitemap_urls(self, request): """Override sitemap listings to add priority for featured posts."""