]> git.parisson.com Git - django-postman.git/commitdiff
Merge remote-tracking branch 'hg/master'
authorGuillaume Pellerin <yomguy@parisson.com>
Mon, 22 Apr 2013 15:07:01 +0000 (17:07 +0200)
committerGuillaume Pellerin <yomguy@parisson.com>
Mon, 22 Apr 2013 15:07:01 +0000 (17:07 +0200)
1  2 
postman/tests.py
postman/utils.py

Simple merge
index eeaf998ddc5473c3cc27ddf54793707b1b6c0e61,f7d5d7c052b63cc65b4a1fa1d36902ee2bc4174d..bcc67baa433be1e8f4804f6f2870afb72e9441bb
@@@ -22,12 -23,9 +23,12 @@@ else
  # but if not installed or not desired, fallback to django.core.mail
  name = getattr(settings, 'POSTMAN_MAILER_APP', 'mailer')
  if name and name in settings.INSTALLED_APPS:
-     send_mail = __import__(name, globals(), locals(), ['send_mail']).send_mail
+     send_mail = __import__(name, globals(), locals(), [str('send_mail')]).send_mail
  else:
 -    from django.core.mail import send_mail
 +    from django.core.mail import send_mail, mail_admins
 +
 +# to disable email notification to users
 +DISABLE_USER_EMAILING = getattr(settings, 'POSTMAN_DISABLE_USER_EMAILING', False)
  
  # to disable email notification to users
  DISABLE_USER_EMAILING = getattr(settings, 'POSTMAN_DISABLE_USER_EMAILING', False)
@@@ -74,8 -75,8 +78,9 @@@ def email(subject_template, message_tem
      message = render_to_string(message_template, ctx_dict)
      # during the development phase, consider using the setting: EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend'
      send_mail(subject, message, settings.DEFAULT_FROM_EMAIL, recipient_list, fail_silently=True)
 +    mail_admins(subject, message)
  
  def email_visitor(object, action):
      """Email a visitor."""
      email('postman/email_visitor_subject.txt', 'postman/email_visitor.txt', [object.email], object, action)