From eda40f3481b6963163a04cc393db2bb95d3c5242 Mon Sep 17 00:00:00 2001 From: Étienne Loks Date: Thu, 27 Mar 2025 14:47:12 +0100 Subject: ♻️ django: fix warnings for v5 - migrate to timezone aware dates MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ishtar_common/management/commands/gdpr_clean.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'ishtar_common/management/commands/gdpr_clean.py') diff --git a/ishtar_common/management/commands/gdpr_clean.py b/ishtar_common/management/commands/gdpr_clean.py index 1f3f413f6..c53d24fcc 100644 --- a/ishtar_common/management/commands/gdpr_clean.py +++ b/ishtar_common/management/commands/gdpr_clean.py @@ -4,6 +4,7 @@ import datetime from django.conf import settings from django.core.management.base import BaseCommand +from django.utils import timezone import sys from ishtar_common.models import GDPRLog, GDPRPerson @@ -15,7 +16,7 @@ def get_time(): def clean_gdpr(): - date = datetime.datetime.now() - ( + date = timezone.now() - ( datetime.timedelta(days=settings.GDPR_RETENTION_PERIOD) ) q = GDPRLog.objects.filter(date__lte=date) -- cgit v1.2.3