andreirk / django-hotclub

Automatically exported from code.google.com/p/django-hotclub
0 stars 0 forks source link

Messages app fails when importing the mailer app without a settings.py check #60

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Currently the the utils.py loads the mailer app without a check
if its in the settings.py

quick fix to make it work

Index: utils.py
===================================================================
--- utils.py    (revision 74)
+++ utils.py    (working copy)
@@ -4,13 +4,17 @@
 from django.template import Context, loader
 from django.template.loader import render_to_string
 from django.conf import settings
+from django.db.models import get_app
+from django.core.exceptions import ImproperlyConfigured

 # favour django-mailer but fall back to django.core.mail
 try:
-    from mailer import send_mail
-except ImportError:
-    from django.core.mail import send_mail
+   mailer = get_app("mailer")
+   from mailer import send_mail
+except ImproperlyConfigured:
+   from django.core.mail import send_mail

Original issue reported on code.google.com by nicholas...@gmail.com on 8 Sep 2008 at 7:49

GoogleCodeExporter commented 9 years ago
Already fixed in messages trunk. Please report app bugs in its own issue list 
next time, thanks :)

Original comment by leidel on 18 Oct 2008 at 9:23