diff options
author | Étienne Loks <etienne.loks@iggdrasil.net> | 2025-03-27 14:47:12 +0100 |
---|---|---|
committer | Étienne Loks <etienne.loks@iggdrasil.net> | 2025-06-13 18:08:06 +0200 |
commit | 84ed3cfb40a64e64ddc32cc0df943cb12e198717 (patch) | |
tree | d4220a3a19ee6ae31fbf281d7e0d35fb5b452cd1 /ishtar_common/management/commands/gdpr_clean.py | |
parent | db174e7f376a3687cb6cd84339592231ceae0ee0 (diff) | |
download | Ishtar-84ed3cfb40a64e64ddc32cc0df943cb12e198717.tar.bz2 Ishtar-84ed3cfb40a64e64ddc32cc0df943cb12e198717.zip |
♻️ django: fix warnings for v5 - migrate to timezone aware dates
Diffstat (limited to 'ishtar_common/management/commands/gdpr_clean.py')
-rw-r--r-- | ishtar_common/management/commands/gdpr_clean.py | 3 |
1 files changed, 2 insertions, 1 deletions
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) |