-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
3681d98
commit b907fdf
Showing
2 changed files
with
22 additions
and
10 deletions.
There are no files selected for viewing
22 changes: 22 additions & 0 deletions
22
deploy/patches/37/0009-fix-dont-crash-if-no-email-events-for-the-record.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
From 26b366735f4e5cb1daa180973abd54a4102d5405 Mon Sep 17 00:00:00 2001 | ||
From: Marc Calvo <[email protected]> | ||
Date: Tue, 27 Aug 2024 10:13:27 +0200 | ||
Subject: [PATCH] fix dont crash if no email_events for the record | ||
|
||
--- | ||
poweremail_signaturit/poweremail_mailbox.py | 2 ++ | ||
1 file changed, 2 insertions(+) | ||
|
||
diff --git a/poweremail_signaturit/poweremail_mailbox.py b/poweremail_signaturit/poweremail_mailbox.py | ||
index ef92b27..b9ae780 100644 | ||
--- a/poweremail_signaturit/poweremail_mailbox.py | ||
+++ b/poweremail_signaturit/poweremail_mailbox.py | ||
@@ -60,6 +60,8 @@ def update_poweremail_certificate( | ||
for certificate in res.get("certificates", []): # Hauria de ser nomes 1 pero bueno | ||
for event in certificate.get("events", []): # Ens guardem tots els events que ha tingut el email | ||
email_events.append((event['created_at'], event["type"])) | ||
+ if not email_events: | ||
+ return False | ||
# Si un dels events es que s'ha arrivat al estat get_email_opened_state, ja en tenim prou amb aixo | ||
if final_certificat_state in [x[1] for x in email_events]: | ||
certificat_state_to_write = final_certificat_state |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters