mfogel/django-simple-email-confirmation — pull request #3 by imposeren (2014-04-14 15:09:43+00:00)
Title: SimpleEmailConfirmationUserMixin is not really optional

documentation says about SimpleEmailConfirmationUserMixin:
> Note: you don't strictly have to do this final step

but I fail to create user when SIMPLE_EMAIL_CONFIRMATION_AUTO_ADD is True:
```
File ".../lib/python2.7/site-packages/simple_email_confirmation/models.py", line 207, in auto_add
email = user.get_primary_email()
AttributeError: 'User' object has no attribute 'get_primary_email'
```

This pull request fixes the problem but it's not DRY. Maybe it's better to create some module level methods like this:
```
def get_primary_email(user):
primary_email_field_name = getattr(user, 'primary_email_field_name', 'email')
return getattr(user, primary_email_field_name)
```

and then use them in mixin and in signal handler