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:
parent
64480fd4ed
commit
3c20402b32
12 changed files with 258 additions and 89 deletions
|
@ -18,6 +18,7 @@ from endpoints.common import common_login, render_page_template, route_show_if,
|
|||
from endpoints.csrf import csrf_protect, generate_csrf_token
|
||||
from util.names import parse_repository_name
|
||||
from util.gravatar import compute_hash
|
||||
from util.useremails import send_email_changed
|
||||
from auth import scopes
|
||||
|
||||
import features
|
||||
|
@ -241,10 +242,13 @@ def confirm_email():
|
|||
new_email = None
|
||||
|
||||
try:
|
||||
user, new_email = model.confirm_user_email(code)
|
||||
user, new_email, old_email = model.confirm_user_email(code)
|
||||
except model.DataModelException as ex:
|
||||
return render_page_template('confirmerror.html', error_message=ex.message)
|
||||
|
||||
if new_email:
|
||||
send_email_changed(user.username, old_email, new_email)
|
||||
|
||||
common_login(user)
|
||||
|
||||
return redirect(url_for('web.user', tab='email')
|
||||
|
|
Reference in a new issue