[Django] #34113: Sitemap: max() arg is an empty sequence

3 views
Skip to first unread message

Django

unread,
Oct 24, 2022, 4:43:18 AM10/24/22
to django-...@googlegroups.com
#34113: Sitemap: max() arg is an empty sequence
----------------------------------------------+------------------------
Reporter: Mikhail Mitrofanov | Owner: nobody
Type: Bug | Status: new
Component: contrib.sitemaps | Version: 4.1
Severity: Normal | Keywords:
Triage Stage: Unreviewed | Has patch: 0
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
----------------------------------------------+------------------------
With empty items sequence Sitemap raise ValueError: max() arg is an empty
sequence

Sitemap example:

{{{
class RealtyPropertySitemap(Sitemap):
changefreq = "monthly"

def items(self):
return Property.objects.filter(is_active=True).only("pk", "slug",
"lastmodified").order_by("pk")

def lastmod(self, obj: Property):
return obj.lastmodified
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/34113>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Reply all
Reply to author
Forward
0 new messages