Skip to content

Commit b7e7806

Browse files
committed
Evitar error cuando no hay events de emails certificados
1 parent 7be8652 commit b7e7806

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

poweremail_signaturit/poweremail_mailbox.py

+2
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,8 @@ def update_poweremail_certificate(
3737
for certificate in res.get("certificates", []): # Hauria de ser nomes 1 pero bueno
3838
for event in certificate.get("events", []): # Ens guardem tots els events que ha tingut el email
3939
email_events.append((event['created_at'], event["type"]))
40+
if not email_events:
41+
return False
4042
# Si un dels events es que s'ha arrivat al estat get_email_opened_state, ja en tenim prou amb aixo
4143
if final_certificat_state in [x[1] for x in email_events]:
4244
certificat_state_to_write = final_certificat_state

0 commit comments

Comments
 (0)