2 parents ebb5357 + 445299a commit 5a0cc71Copy full SHA for 5a0cc71
1 file changed
blog/models.py
@@ -39,8 +39,6 @@ def was_published_recently(self):
39
Returns:
40
bool: True if the post was published recently, False otherwise.
41
"""
42
- now = timezone.now()
43
- return now - datetime.timedelta(days=1) <= self.pub_date <= now
44
return self.pub_date >= timezone.now().date() - datetime.timedelta(days=7)
45
46
was_published_recently.admin_order_field = "pub_date"
0 commit comments