app/soc/logic/mail_dispatcher.py
changeset 2237 3cfaa7dfd9e0
parent 2073 6eb9b4652c80
child 2242 0326d394dce5
equal deleted inserted replaced
2236:8a74f5cc12b1 2237:3cfaa7dfd9e0
   146     return (site_entity.site_name, site_entity.noreply_email)
   146     return (site_entity.site_name, site_entity.noreply_email)
   147 
   147 
   148   # use the email address of the current logged in user
   148   # use the email address of the current logged in user
   149   account = accounts.getCurrentAccount(normalize=False)
   149   account = accounts.getCurrentAccount(normalize=False)
   150 
   150 
   151   # we need to retrieve account seperately, as user_logic normalizes it
   151   # we need to retrieve account separately, as user_logic normalizes it
   152   # and the GAE admin API is case sensitive
   152   # and the GAE admin API is case sensitive
   153   user_entity = user_logic.logic.getForAccount(account)
   153   user_entity = user_logic.logic.getForAccount(account)
   154 
   154 
   155   if not account:
   155   if not (account and user_entity):
   156     logging.warning('Non-Authenticated user triggered getDefaultMailSender')
   156     logging.warning('Non-Authenticated user triggered getDefaultMailSender')
   157     return None
   157     return None
   158 
   158 
   159   return (user_entity.name, account.email())
   159   return (user_entity.name, account.email())