mirror of
https://github.com/ramvignesh-b/pi-ku.git
synced 2026-05-04 15:56:56 +00:00
refactor: update email notification to account for proper arguments
This commit is contained in:
@@ -35,7 +35,7 @@ def notify_unlocked_letter(letter):
|
||||
plaint_content = render_to_string("email/vault_unlock.txt", context=context)
|
||||
html_content = render_to_string("email/vault_unlock.html", context=context)
|
||||
send_mail(
|
||||
subject,
|
||||
subject=subject,
|
||||
message=plaint_content,
|
||||
from_email=settings.FROM_EMAIL,
|
||||
recipient_list=[author],
|
||||
@@ -45,8 +45,8 @@ def notify_unlocked_letter(letter):
|
||||
letter.notified_at = datetime.now(UTC)
|
||||
letter.save()
|
||||
logger.info(f"Successfully notified {author} of unlocked letter")
|
||||
except Exception as e:
|
||||
logger.exception(f"Failed to notify {author} of unlocked letter", str(e))
|
||||
except Exception:
|
||||
logger.exception(f"Failed to notify {author} of unlocked letter")
|
||||
|
||||
|
||||
def vault_unlock_notification_polling_scheduler():
|
||||
|
||||
@@ -396,6 +396,7 @@ class LetterTaskTest(TestCase):
|
||||
from_email=settings.FROM_EMAIL,
|
||||
recipient_list=[self.user.email],
|
||||
fail_silently=False,
|
||||
html_message=ANY,
|
||||
)
|
||||
self.assertIsNotNone(letter_to_notify1.notified_at)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user