From f9babe7089e810307ba26576728690b8ce7241d7 Mon Sep 17 00:00:00 2001 From: "Langhammer, Jens" Date: Fri, 11 Oct 2019 14:23:59 +0200 Subject: [PATCH] core(minor): fix timezone warning when cleaning nonces --- passbook/core/tasks.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/passbook/core/tasks.py b/passbook/core/tasks.py index 205572b65..5e2c3ab8d 100644 --- a/passbook/core/tasks.py +++ b/passbook/core/tasks.py @@ -1,5 +1,5 @@ """passbook core tasks""" -from datetime import datetime +from django.utils.timezone import now from structlog import get_logger @@ -11,5 +11,5 @@ LOGGER = get_logger() @CELERY_APP.task() def clean_nonces(): """Remove expired nonces""" - amount, _ = Nonce.objects.filter(expires__lt=datetime.now(), expiring=True).delete() + amount, _ = Nonce.objects.filter(expires__lt=now(), expiring=True).delete() LOGGER.debug("Deleted expired nonces", amount=amount)