Replace timezone.now().date() by date.today()

This commit is contained in:
Yohann D'ANELLO 2020-08-16 00:35:11 +02:00
parent 2495128755
commit 81709539a2
1 changed files with 3 additions and 2 deletions

View File

@ -1,10 +1,11 @@
# Copyright (C) 2018-2020 by BDE ENS Paris-Saclay # Copyright (C) 2018-2020 by BDE ENS Paris-Saclay
# SPDX-License-Identifier: GPL-3.0-or-later # SPDX-License-Identifier: GPL-3.0-or-later
from datetime import date
from django.core.mail import send_mail from django.core.mail import send_mail
from django.core.management import BaseCommand from django.core.management import BaseCommand
from django.template.loader import render_to_string from django.template.loader import render_to_string
from django.utils import timezone
from django.utils.translation import activate from django.utils.translation import activate
from note.models import NoteUser from note.models import NoteUser
@ -21,7 +22,7 @@ class Command(BaseCommand):
activate('fr') activate('fr')
notes = NoteUser.objects.filter( notes = NoteUser.objects.filter(
balance__lte=-options["negative_amount"], 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() ).order_by('balance').distinct().all()
if options["spam"]: if options["spam"]: