changeset 3448:cf665eb84d4c beta

notification model should only send html emails not generating multipart ones
author Marcin Kuzminski <marcin@python-works.com>
date Mon, 04 Mar 2013 12:12:38 +0100
parents e74557f57f76
children 95a226b35b91
files rhodecode/lib/celerylib/tasks.py rhodecode/model/notification.py
diffstat 2 files changed, 5 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/rhodecode/lib/celerylib/tasks.py	Sun Mar 03 23:35:39 2013 +0100
+++ b/rhodecode/lib/celerylib/tasks.py	Mon Mar 04 12:12:38 2013 +0100
@@ -254,7 +254,7 @@
 
 @task(ignore_result=True)
 @dbsession
-def send_email(recipients, subject, body, html_body=''):
+def send_email(recipients, subject, body='', html_body=''):
     """
     Sends an email with defined parameters from the .ini files.
 
@@ -282,7 +282,7 @@
     mail_port = email_config.get('smtp_port')
     tls = str2bool(email_config.get('smtp_use_tls'))
     ssl = str2bool(email_config.get('smtp_use_ssl'))
-    debug = str2bool(config.get('debug'))
+    debug = str2bool(email_config.get('debug'))
     smtp_auth = email_config.get('smtp_auth')
 
     if not mail_server:
--- a/rhodecode/model/notification.py	Sun Mar 03 23:35:39 2013 +0100
+++ b/rhodecode/model/notification.py	Mon Mar 04 12:12:38 2013 +0100
@@ -109,9 +109,10 @@
         # send email with notification to all other participants
         for rec in rec_objs:
             if not email_subject:
-                email_subject = NotificationModel().make_description(notif, show_age=False)
+                email_subject = NotificationModel()\
+                                    .make_description(notif, show_age=False)
             type_ = type_
-            email_body = body
+            email_body = None  # we set body to none, we just send HTML emails
             ## this is passed into template
             kwargs = {'subject': subject, 'body': h.rst_w_mentions(body)}
             kwargs.update(email_kwargs)