# HG changeset patch # User Sverre Rabbelier # Date 1235779807 0 # Node ID 15caebd3304dc054efa8328cc981a9736cb35db7 # Parent c8c269ef0498490612655a5168ed41a20a3c08a5 Denormalize accounts before trying to send e-mail Otherwise accounts that are in the auth domain are not a valid e-mail address. Patch by: Sverre Rabbelier diff -r c8c269ef0498 -r 15caebd3304d app/soc/logic/helper/notifications.py --- a/app/soc/logic/helper/notifications.py Sat Feb 28 00:09:34 2009 +0000 +++ b/app/soc/logic/helper/notifications.py Sat Feb 28 00:10:07 2009 +0000 @@ -33,6 +33,7 @@ # We cannot import soc.logic.models notification nor user here # due to cyclic imports +from soc.logic import accounts from soc.logic import dicts from soc.logic import mail_dispatcher from soc.views.helper import redirects @@ -182,11 +183,13 @@ # no valid sender found, abort return + 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, - 'to': notification_entity.scope.account.email(), + 'to': to, 'sender': sender, 'subject': force_unicode(DEF_NEW_NOTIFICATION_MSG), 'notification' : notification_entity, @@ -216,12 +219,14 @@ # no valid sender found, should not happen but abort anyway return + to = accounts.denormalizeAccount(user_entity.account).email() + # create the message contents messageProperties = { 'to_name': user_entity.name, 'sender_name': site_name, 'site_name': site_name, - 'to': user_entity.account.email(), + 'to': to, 'sender': sender, 'subject': DEF_WELCOME_MSG_FMT % { 'site_name': site_name, diff -r c8c269ef0498 -r 15caebd3304d app/soc/logic/mail_dispatcher.py --- a/app/soc/logic/mail_dispatcher.py Sat Feb 28 00:09:34 2009 +0000 +++ b/app/soc/logic/mail_dispatcher.py Sat Feb 28 00:10:07 2009 +0000 @@ -68,6 +68,7 @@ from google.appengine.api import mail +from soc.logic import accounts from soc.logic import dicts @@ -145,4 +146,4 @@ logging.warning('Non-Authenticated user triggered getDefaultMailSender') return None - return account_entity.email() + return accounts.denormalizeAccount(account_entity).email()