﻿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
26339	In tutorial 07, a was_published_recently method definition should be modified to reflect previous modifications	Damien Caselli	nobody	"In the [https://docs.djangoproject.com/en/1.9/intro/tutorial07/#customize-the-admin-change-list Customize the admin change list section], the `Question` class order improvements show an old version of the `was_published_recently` method.

It gets improved in the [https://docs.djangoproject.com/en/1.9/intro/tutorial05/#fixing-the-bug Tutorial 5 section].

It shows:

{{{#!python
class Question(models.Model):
    # ...
    def was_published_recently(self):
        return self.pub_date >= timezone.now() - datetime.timedelta(days=1)
}}}

When it should be:

{{{#!python
class Question(models.Model):
    # ...
    def was_published_recently(self):
        now = timezone.now()
        return now - datetime.timedelta(days=1) <= self.pub_date <= now
}}}"	Uncategorized	closed	Uncategorized	1.9	Normal	fixed	docs		Unreviewed	0	0	0	0	0	0
