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"]: