﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
6888	archive_month generic view returns item from next month	scottb	nobody	"I found the archive_month date based generic view can return objects from the next month.  e.g. the view for objects in February will return objects for 1st March as well.  It seems to be an issue when the model has a DateField, a DateTimeField set to a datetime.date, or a DateTimeField set to a datetime with time zero/midnight.  Essentially any date on the first of the month where time is zero.

The archive_month view uses range e.g. 1st February to 1st March.  This was done for ticket #992 long ago.  If the object in March is a datetime with at least 1 second past midnight, it works fine.  But when it's midnight (or a date instead of datetime), it falls in to the February range.

Attached is a patch to the regression tests to show what I mean.  Also attached are a couple of possible fixes:

Fix 1: checks the year and month instead of using range.
Fix 2: uses gte and lt instead of range.

The same issue may affect the archive_week view.  If I'm on the right track, I can write tests/patches for that."		closed	Generic views	dev		invalid	archive_month,generic views		Unreviewed	1	0	0	0	0	0
