diff --git a/endpoints/oauthlogin.py b/endpoints/oauthlogin.py index f1bffc064..538117f95 100644 --- a/endpoints/oauthlogin.py +++ b/endpoints/oauthlogin.py @@ -1,5 +1,4 @@ import logging -import uuid from flask import request, redirect, url_for, Blueprint from peewee import IntegrityError @@ -60,16 +59,12 @@ def _conduct_oauth_login(service_id, service_name, user_id, username, email, met new_username = valid 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) to_login = model.user.create_federated_user(new_username, email, service_id, user_id, set_password_notification=True, metadata=metadata or {}, - prompts=prompts) + prompts=prompts, + email_required=features.MAILING) # Success, tell analytics analytics.track(to_login.username, 'register', {'service': service_name.lower()})