I’ve taken a look into the code. The problem is that Post used to be a TranslatableModel (django-parler), but isn’t anymore, so that posts = Post.objects.translated(lang).language(lang).published() doesn’t work anymore. Replacing that line with posts = Post.objects.filter(publish=True) works, but there’s no language selection in it, and then the next error happens just some lines later with smart_override which is also a django-parler function.
I wanted to fix this issue, but I think I’m lacking the insight of the data model and the replacement of django-parler TranslatableModel for Post.
Description
The creation of a sitemap for blog posts is aborted with an error.
Steps to reproduce
Add
BlogSitemap
to yoursitemaps
:Versions
Python 3.11, Django 5.1.2, django CMS 4.1.3, djangocms-blog commit 4efe3ba11ca9f6ff8943a8482359a9e2b2a17288
Additional information
I’ve taken a look into the code. The problem is that
Post
used to be a TranslatableModel (django-parler), but isn’t anymore, so thatposts = Post.objects.translated(lang).language(lang).published()
doesn’t work anymore. Replacing that line withposts = Post.objects.filter(publish=True)
works, but there’s no language selection in it, and then the next error happens just some lines later withsmart_override
which is also a django-parler function.I wanted to fix this issue, but I think I’m lacking the insight of the data model and the replacement of django-parler
TranslatableModel
forPost
.