Skip to content

[BUG] Returning items of sitemap as list causes an error in djangocms_page_sitemap #8029

@MacLake

Description

@MacLake

Description

When using djangocms_page_sitemap, which gives more options to the generated sitemap, the generation is abortedwith an error because exclude() can’t be applied to a list.

According to the Django docs a sequence like a list is allowed, so this is not really a bug in that sense, but it causes a bug when using djangocms_page_sitemap, which applies exclude and therefore only works with
QuerySets, not with lists.

And I don’t see a reason to convert the QuerySet to a list.

Steps to reproduce

  1. Install djangocms_page_sitemap
  2. Add an ExtendedSitemap to your sitemaps definition

Additional information (CMS/Python/Django versions)

Just removing the list conversion works for me. Would it cause other problems? I have created a fork and applied the fix by removing the list conversion. I can create a PR if wanted..........................................................................................................................................................................................................

Do you want to help fix this issue?

  • Yes, I want to help fix this issue and I will join the channel #pr-reviews on the Discord Server to confirm with the community that a PR is welcome.
  • No, I only want to report the issue.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions