From 6c7415a7ff9e55a20ed69c909341a706f6ab0424 Mon Sep 17 00:00:00 2001 From: Raphael Michel Date: Wed, 15 Feb 2023 15:05:13 +0100 Subject: [PATCH] Use now() instead of utcnow() --- src/pretix/base/services/currencies.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/pretix/base/services/currencies.py b/src/pretix/base/services/currencies.py index 09e0a3c13..ad0464c49 100644 --- a/src/pretix/base/services/currencies.py +++ b/src/pretix/base/services/currencies.py @@ -26,6 +26,7 @@ import requests from django.conf import settings from django.db.models import Max from django.dispatch import receiver +from django.utils.timezone import now from django.utils.translation import gettext_lazy as _ from lxml import etree @@ -57,7 +58,7 @@ def fetch_rates(sender, **kwargs): continue last_fetch_date = ExchangeRate.objects.filter(source=source_name).aggregate(m=Max('updated'))['m'] - if last_fetch_date and last_fetch_date >= datetime.utcnow() - timedelta(hours=1): + if last_fetch_date and last_fetch_date >= now() - timedelta(hours=1): # Only try to fetch once per hour continue