Skip to content
GitLab
Explore
Sign in
Commits on Source (1)
Update last report date only in non-debug mode
· 13322189
ynerant
authored
Apr 08, 2021
Signed-off-by:
Yohann D'ANELLO
<
ynerant@crans.org
>
13322189
Hide whitespace changes
Inline
Side-by-side
management/commands/send_reports.py
View file @
13322189
...
...
@@ -33,8 +33,9 @@ class Command(BaseCommand):
delta
=
now
.
date
()
-
last_report
.
date
()
if
delta
.
days
<
note
.
user
.
profile
.
report_frequency
:
continue
note
.
user
.
profile
.
last_report
=
now
note
.
user
.
profile
.
save
()
if
not
options
[
"
debug
"
]:
note
.
user
.
profile
.
last_report
=
now
note
.
user
.
profile
.
save
()
last_transactions
=
Transaction
.
objects
.
filter
(
Q
(
source
=
note
)
|
Q
(
destination
=
note
),
created_at__gte
=
last_report
,
...
...