From 9f1650693b23959888d27d135b18ec029486d145 Mon Sep 17 00:00:00 2001 From: Marco Rougeth Date: Wed, 14 May 2014 11:14:14 -0300 Subject: [PATCH] Add support to tzinfo --- dpaste/management/commands/cleanup_snippets.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dpaste/management/commands/cleanup_snippets.py b/dpaste/management/commands/cleanup_snippets.py index a9feea5..c3bf873 100644 --- a/dpaste/management/commands/cleanup_snippets.py +++ b/dpaste/management/commands/cleanup_snippets.py @@ -1,7 +1,7 @@ -import datetime import sys from optparse import make_option from django.core.management.base import LabelCommand +from django.utils import timezone from dpaste.models import Snippet class Command(LabelCommand): @@ -15,7 +15,7 @@ class Command(LabelCommand): deleteable_snippets = Snippet.objects.filter( expires__isnull=False, expire_type=Snippet.EXPIRE_TIME, - expires__lte=datetime.datetime.now() + expires__lte=timezone.now() ) sys.stdout.write(u"%s snippets gets deleted:\n" % deleteable_snippets.count()) for d in deleteable_snippets: