From 7b594cfdc0049a1e5fc7ae8930c955a84f06bf45 Mon Sep 17 00:00:00 2001 From: Alex Garel Date: Thu, 10 Nov 2011 12:19:57 +0100 Subject: [PATCH] Added a warning if no message notification template found in database --- helpdesk/lib.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/helpdesk/lib.py b/helpdesk/lib.py index 05469588..e1f83e70 100644 --- a/helpdesk/lib.py +++ b/helpdesk/lib.py @@ -17,6 +17,9 @@ try: except ImportError: from base64 import decodestring as b64decode +import logging +logger = logging.getLogger('helpdesk') + from django.utils.encoding import smart_str def send_templated_mail(template_name, email_context, recipients, sender=None, bcc=None, fail_silently=False, files=None): @@ -66,6 +69,8 @@ def send_templated_mail(template_name, email_context, recipients, sender=None, b try: t = EmailTemplate.objects.get(template_name__iexact=template_name, locale__isnull=True) except EmailTemplate.DoesNotExist: + logger.warning('template "%s" does not exist, no mail sent' % + template_name) return # just ignore if template doesn't exist if not sender: