Handle duplicate emails on confirmation and make the confirmation error page nicer
This commit is contained in:
parent
bd5ebe070b
commit
c738113ca4
3 changed files with 26 additions and 3 deletions
|
@ -358,8 +358,11 @@ def confirm_user_email(code):
|
|||
|
||||
new_email = code.new_email
|
||||
if new_email:
|
||||
if find_user_by_email(new_email):
|
||||
raise DataModelException('E-mail address already used.')
|
||||
|
||||
user.email = new_email
|
||||
|
||||
|
||||
user.save()
|
||||
|
||||
code.delete_instance()
|
||||
|
|
Reference in a new issue