Use timezone.now instead of datetime.now
This commit is contained in:
parent
a33e1cfb1f
commit
d488c1e021
1 changed files with 2 additions and 2 deletions
|
@ -1,10 +1,10 @@
|
|||
from datetime import datetime
|
||||
from django.utils import timezone
|
||||
|
||||
from django.db import models
|
||||
|
||||
|
||||
class PublishedPageManager(models.Manager):
|
||||
|
||||
return qs.filter(publish_date__lte=datetime.now())
|
||||
def get_queryset(self):
|
||||
qs = super(PublishedPageManager, self).get_queryset()
|
||||
return qs.filter(publish_date__lte=timezone.now())
|
||||
|
|
Loading…
Reference in a new issue