From 79fdfeb620c9b95ad44c34a22d5d661baa55bc92 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/forms.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'ishtar_common/forms.py') diff --git a/ishtar_common/forms.py b/ishtar_common/forms.py index ac0c638e1..7856d2d64 100644 --- a/ishtar_common/forms.py +++ b/ishtar_common/forms.py @@ -35,7 +35,7 @@ from django.core.exceptions import ValidationError from django.core import validators from django.forms.formsets import BaseFormSet, DELETION_FIELD_NAME from django.urls import reverse -from django.utils import formats, translation +from django.utils import formats, translation, timezone from django.utils.functional import lazy from django.utils.safestring import mark_safe from django.utils.text import slugify @@ -1178,7 +1178,7 @@ class DocumentItemSelect(ImportSelect): def get_now(): - return datetime.datetime.now().strftime(formats.get_format("DATE_INPUT_FORMATS")[0]) + return timezone.now().strftime(formats.get_format("DATE_INPUT_FORMATS")[0]) class ClosingDateFormSelection(IshtarForm): -- cgit v1.2.3