Skip to content
GitLab
Explore
Sign in
Commits on Source (1)
Replace timezone.now().date() by date.today()
· 81709539
ynerant
authored
Aug 16, 2020
81709539
Hide whitespace changes
Inline
Side-by-side
management/commands/send_mail_to_negative_balances.py
View file @
81709539
# 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
"
]:
...
...