From 81709539a2b4b230f506291085fbee3d7d9ac9a2 Mon Sep 17 00:00:00 2001 From: Yohann D'ANELLO Date: Sun, 16 Aug 2020 00:35:11 +0200 Subject: [PATCH] Replace timezone.now().date() by date.today() --- management/commands/send_mail_to_negative_balances.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/management/commands/send_mail_to_negative_balances.py b/management/commands/send_mail_to_negative_balances.py index 00ce4b5..bca6736 100644 --- a/management/commands/send_mail_to_negative_balances.py +++ b/management/commands/send_mail_to_negative_balances.py @@ -1,10 +1,11 @@ # Copyright (C) 2018-2020 by BDE ENS Paris-Saclay # SPDX-License-Identifier: GPL-3.0-or-later +from datetime import date + from django.core.mail import send_mail from django.core.management import BaseCommand from django.template.loader import render_to_string -from django.utils import timezone from django.utils.translation import activate from note.models import NoteUser @@ -21,7 +22,7 @@ class Command(BaseCommand): activate('fr') notes = NoteUser.objects.filter( balance__lte=-options["negative_amount"], - user__memberships__date_end__gte=timezone.now().date(), + user__memberships__date_end__gte=date.today(), ).order_by('balance').distinct().all() if options["spam"]: