Add a common base email template, translate the emails over to using jinja and add emails when e-mail addresses and passwords are changed.

This commit is contained in:
Joseph Schorr 2014-09-05 19:57:33 -04:00
parent 64480fd4ed
commit 3c20402b32
12 changed files with 258 additions and 89 deletions

View file

@ -456,18 +456,20 @@ def confirm_user_email(code):
user = code.user
user.verified = True
old_email = None
new_email = code.new_email
if new_email:
if find_user_by_email(new_email):
raise DataModelException('E-mail address already used.')
old_email = user.email
user.email = new_email
user.save()
code.delete_instance()
return user, new_email
return user, new_email, old_email
def create_reset_password_email_code(email):