only send email when a note actually has content
Some checks failed
docker-image / docker (push) Has been cancelled

This commit is contained in:
lilly 2026-02-09 14:33:22 +01:00
commit 2da0096453
Signed by: lilly
SSH key fingerprint: SHA256:y9T5GFw2A20WVklhetIxG1+kcg/Ce0shnQmbu1LQ37g

View file

@ -215,6 +215,8 @@ class HedgedocExpire:
with db.prepare('DELETE FROM "Notes" WHERE "id" = $1') as delete_statement: with db.prepare('DELETE FROM "Notes" WHERE "id" = $1') as delete_statement:
for note in self.notes_to_be_expired(db): for note in self.notes_to_be_expired(db):
try: try:
if len(note["content"]) > 0:
note_age = datetime.now(timezone.utc) - datetime.fromisoformat(note['updatedAt']) note_age = datetime.now(timezone.utc) - datetime.fromisoformat(note['updatedAt'])
msg = MIMEMultipart() msg = MIMEMultipart()
msg['From'] = self.email_sender.mail_from msg['From'] = self.email_sender.mail_from