0
0
mirror of https://github.com/wagtail/wagtail.git synced 2024-12-01 11:41:20 +01:00

Use latest_revision_created_at in sitemap gen

Much faster than looking it up manually for every page in the site
This commit is contained in:
Karl Hobley 2014-10-17 17:16:36 +01:00
parent d770e94687
commit 7659bf23d3

View File

@ -794,12 +794,10 @@ class Page(six.with_metaclass(PageBase, MP_Node, ClusterableModel, index.Indexed
return ['/']
def get_sitemap_urls(self):
latest_revision = self.get_latest_revision()
return [
{
'location': self.full_url,
'lastmod': latest_revision.created_at if latest_revision else None
'lastmod': self.latest_revision_created_at
}
]