Remove unnecessary email generation in OAuth login
Handled by the `emaIl_required` flag already
This commit is contained in:
parent
c8e5eb5ad1
commit
c6b0376d61
1 changed files with 2 additions and 7 deletions
|
@ -1,5 +1,4 @@
|
||||||
import logging
|
import logging
|
||||||
import uuid
|
|
||||||
|
|
||||||
from flask import request, redirect, url_for, Blueprint
|
from flask import request, redirect, url_for, Blueprint
|
||||||
from peewee import IntegrityError
|
from peewee import IntegrityError
|
||||||
|
@ -60,16 +59,12 @@ def _conduct_oauth_login(service_id, service_name, user_id, username, email, met
|
||||||
new_username = valid
|
new_username = valid
|
||||||
break
|
break
|
||||||
|
|
||||||
# Generate a valid email. If the email is None and the MAILING feature is turned
|
|
||||||
# off, simply place in a fake email address.
|
|
||||||
if email is None and not features.MAILING:
|
|
||||||
email = '%s@fake.example.com' % (str(uuid.uuid4()))
|
|
||||||
|
|
||||||
prompts = model.user.get_default_user_prompts(features)
|
prompts = model.user.get_default_user_prompts(features)
|
||||||
to_login = model.user.create_federated_user(new_username, email, service_id,
|
to_login = model.user.create_federated_user(new_username, email, service_id,
|
||||||
user_id, set_password_notification=True,
|
user_id, set_password_notification=True,
|
||||||
metadata=metadata or {},
|
metadata=metadata or {},
|
||||||
prompts=prompts)
|
prompts=prompts,
|
||||||
|
email_required=features.MAILING)
|
||||||
|
|
||||||
# Success, tell analytics
|
# Success, tell analytics
|
||||||
analytics.track(to_login.username, 'register', {'service': service_name.lower()})
|
analytics.track(to_login.username, 'register', {'service': service_name.lower()})
|
||||||
|
|
Reference in a new issue