[4.1.x] Fixed #34088 -- Fixed Sitemap.get_latest_lastmod() crash with empty items.

Bug in 480191244d.

Thanks Michal Čihař for the report.

Backport of 5eab4d1924 from main
This commit is contained in:
Daniel Ivanov 2022-11-04 16:43:40 +03:00 committed by Mariusz Felisiak
parent 84a2b2e7a7
commit eca526eab0
4 changed files with 35 additions and 1 deletions

View file

@ -11,3 +11,8 @@ Bugfixes
* Fixed a regression in Django 4.1 that caused an unnecessary table rebuilt
when adding ``ManyToManyField`` on SQLite (:ticket:`34138`).
* Fixed a bug in Django 4.1 that caused a crash of the sitemap index view with
an empty :meth:`Sitemap.items() <django.contrib.sitemaps.Sitemap.items>` and
a callable :attr:`~django.contrib.sitemaps.Sitemap.lastmod`
(:ticket:`34088`).