Skip to content
This repository has been archived by the owner on Nov 22, 2023. It is now read-only.

Commit

Permalink
(PC-10223) Fix json not parsing datetime.datime object
Browse files Browse the repository at this point in the history
  • Loading branch information
VictorEnaud committed Aug 6, 2021
1 parent d24ebc8 commit 480afeb
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/pcapi/scripts/payment/fix_retried_payments_status.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,11 @@ def fix_retried_payments_status() -> None:
logger.info("Begin script", extra={"script": "fix_retried_payments_status"})
execution_dates = _get_execution_dates()
logger.info(
"Execution dates retrieved", extra={"executionDates": execution_dates, "script": "fix_retried_payments_status"}
"Execution dates retrieved",
extra={
"executionDates": [execution_date.strftime("%Y-%m-%d") for execution_date in execution_dates],
"script": "fix_retried_payments_status",
},
)
updated_payments_count = 0
for execution_date in execution_dates:
Expand All @@ -73,9 +77,9 @@ def fix_retried_payments_status() -> None:
logger.info(
"Fix given execution date",
extra={
"executionDate": execution_date,
"executionDate": execution_date.strftime("%Y-%m-%d"),
"transactionLabel": transaction_label,
"sentDate": sent_date,
"sentDate": sent_date.strftime("%Y-%m-%d %H:%M:%S") if sent_date else None,
"retriedPaymentsCount": len(retried_payments),
"script": "fix_retried_payments_status",
},
Expand Down

0 comments on commit 480afeb

Please sign in to comment.