Opened 9 years ago

Closed 9 years ago

#25989 closed Bug (fixed)

sitemap view picks lastmod from last supplied sitemap only

Reported by: allixx Owned by: nobody
Component: contrib.sitemaps Version: dev
Severity: Normal Keywords: sitemap lastmod
Cc: Triage Stage: Ready for checkin
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

When passing several sitemaps as a parameter to sitemap view, only last sitemap's lastmod is used for 'Last-Modified' response header.

Maximum lastmod should be picked from all passed sitemaps lasmods instead.

The same problem exists in 1.8 and 1.9.

Attachments (1)

views.py.diff (1.6 KB ) - added by allixx 9 years ago.
django/contrib/sitemaps/views.py

Download all attachments as: .zip

Change History (9)

by allixx, 9 years ago

Attachment: views.py.diff added

django/contrib/sitemaps/views.py

comment:1 by Tim Graham, 9 years ago

Has patch: set
Needs tests: set
Triage Stage: UnreviewedAccepted

Please uncheck "Needs tests" if you can add them to the pull request.

comment:2 by allixx, 9 years ago

Needs tests: unset

comment:3 by allixx, 9 years ago

Needs tests: set

comment:4 by allixx, 9 years ago

I'm working on adding the tests.

comment:5 by allixx, 9 years ago

Needs tests: unset

Tests added to pull request.

comment:6 by Eric, 9 years ago

Triage Stage: AcceptedReady for checkin
Version 0, edited 9 years ago by Eric (next)

comment:7 by Tim Graham, 9 years ago

I think this isn't a critical bug to backport. The sitemap Last-Modified header functionality is new in Django 1.7 -- if it had been reported shortly after that release it would be easier to justify a backport.

comment:8 by Tim Graham <timograham@…>, 9 years ago

Resolution: fixed
Status: newclosed

In 002a4f72:

Fixed #25989 -- Corrected sitemap's Last-Modified header to use the latest lastmod of all sitemaps.

Previously, the lastmod of the last sitemap was always used.
All sitemaps are required to have a lastmod.

Note: See TracTickets for help on using tickets.
Back to Top