Commit 0f3b105a authored by Michal Čihař's avatar Michal Čihař

Force validation of new email address

parent d9e5fbcf
......@@ -35,6 +35,14 @@ def require_email(strategy, details, user=None, is_new=False,
Forces entering email for backends which don't provide it.
'''
if user and user.email:
# Force validation of new email address
if strategy.backend_name == 'email':
email = details.get('email')
if email and user.email != email:
return {'is_new': True}
return
elif is_new and not details.get('email'):
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment