Skip to content

Commit

Permalink
remove unused method
Browse files Browse the repository at this point in the history
  • Loading branch information
MarcCalvoC committed Feb 4, 2025
1 parent 3681d98 commit b907fdf
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 10 deletions.
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
10 changes: 0 additions & 10 deletions poweremail_references/poweremail_mailbox.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,16 +76,6 @@ def restrict_write_callback_from_previous_emails(self, cursor, uid, ref, func, v
restrict = False
return restrict

def get_certificate_email_ids_with_same_ref(self, cursor, uid, ref, context=None):
if context is None:
context = {}
email_ids = self.search(cursor, uid, [
('certificat', '=', True),
('reference', '=', ref)
], context=context)
email_ids.sort(reverse=True)
return email_ids

def create(self, cursor, uid, vals, context=None):
if context is None:
context = {}
Expand Down

0 comments on commit b907fdf

Please sign in to comment.