Author: brosner
Date: Sun Jan 4 00:39:23 2009
New Revision: 130
Modified:
branches/pluggable-backends/notification/backends/email.py
Log:
pluggable-backends: Use get_app over to include django-mailer support over
a standard import and ImportError exception handling.
Modified: branches/pluggable-backends/notification/backends/email.py
==============================================================================
--- branches/pluggable-backends/notification/backends/email.py (original)
+++ branches/pluggable-backends/notification/backends/email.py Sun Jan 4
00:39:23 2009
@@ -1,17 +1,20 @@
from django.conf import settings
+from django.db.models.loading import get_app
from django.core.urlresolvers import reverse
from django.template.loader import render_to_string
from django.utils.translation import ugettext
from django.contrib.sites.models import Site
+from django.core.exceptions import ImproperlyConfigured
from notification import backends
from notification.message import message_to_text
# favour django-mailer but fall back to django.core.mail
try:
+ mailer = get_app("mailer")
from mailer import send_mail
-except ImportError:
+except ImproperlyConfigured:
from django.core.mail import send_mail
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"pinax-updates" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/pinax-updates?hl=en
-~----------~----~----~----~------~----~------~--~---