bread-and-pepper/django-userena — pull request #244 by aethemba (2012-10-23 14:13:52+00:00)
Title: Sending mail to old email addresses if they exist

Hi,

Recently I came across an issue when migrating to Userena in an existing project. In this project we had over a few thousand users without an email address.

The ability to change your e-mail address using Userena, however, was failing because Userena attempts to send an email to the old email address. Yet in this use case there are no old email addresses, (more specifially, user.email is an empty unicode string), and our server returned SMTPRecipientsRefused errors.

I made a quick fix by wrapping the send_mail function on line 135 of models.py in an if statement. Only when an old email address exists does it attempt to send a mail.

This was a quick solution for us and I can image that this will become a valid use-case as more and more people may incorporate Userena into their (existing) projects.

Kind regards,
Aksel