Make email addresses optional in external auth if email feature is turned off
Before this change, external auth such as Keystone would fail if a user without an email address tried to login, even if the email feature was disabled.
This commit is contained in:
parent
934cdecbd6
commit
d7f56350a4
18 changed files with 206 additions and 93 deletions
|
@ -5,10 +5,10 @@ from data.model import (user, team, DataModelException, InvalidOrganizationExcep
|
|||
InvalidUsernameException, db_transaction, _basequery)
|
||||
|
||||
|
||||
def create_organization(name, email, creating_user):
|
||||
def create_organization(name, email, creating_user, email_required=True):
|
||||
try:
|
||||
# Create the org
|
||||
new_org = user.create_user_noverify(name, email)
|
||||
new_org = user.create_user_noverify(name, email, email_required=email_required)
|
||||
new_org.organization = True
|
||||
new_org.save()
|
||||
|
||||
|
|
Reference in a new issue