app/soc/logic/helper/notifications.py
changeset 1550 a872030dc3ca
parent 1548 15caebd3304d
child 1560 656aace0b15f
--- a/app/soc/logic/helper/notifications.py	Sat Feb 28 00:41:36 2009 +0000
+++ b/app/soc/logic/helper/notifications.py	Sat Feb 28 10:25:41 2009 +0000
@@ -179,16 +179,21 @@
 
   sender = mail_dispatcher.getDefaultMailSender()
 
-  if not sender:
+  # get the default mail sender
+  default_sender = mail_dispatcher.getDefaultMailSender()
+
+  if not default_sender:
     # no valid sender found, abort
     return
+  else:
+    (sender_name, sender) = default_sender
 
   to = accounts.denormalizeAccount(notification_entity.scope.account).email()
 
   # create the message contents
   messageProperties = {
       'to_name': notification_entity.scope.name,
-      'sender_name': current_user_entity.name,
+      'sender_name': sender_name,
       'to': to,
       'sender': sender,
       'subject': force_unicode(DEF_NEW_NOTIFICATION_MSG),
@@ -213,18 +218,20 @@
   site_name = site_entity.site_name
 
   # get the default mail sender
-  sender = mail_dispatcher.getDefaultMailSender()
+  default_sender = mail_dispatcher.getDefaultMailSender()
 
-  if not sender:
+  if not default_sender:
     # no valid sender found, should not happen but abort anyway
     return
+  else:
+    (sender_name, sender) = default_sender
 
   to = accounts.denormalizeAccount(user_entity.account).email()
 
   # create the message contents
   messageProperties = {
       'to_name': user_entity.name,
-      'sender_name': site_name,
+      'sender_name': sender_name,
       'site_name': site_name,
       'to': to,
       'sender': sender,