Allow team syncing if user creation is disabled
Before this change, if user creation was disabled, team sync would fail to sync over users that had not yet been invited/logged in, because their accounts could not be created. Following this change, team syncing of users not yet in the system will create those user accounts, allowing users to be "auto invited" via team sync. Fixes https://jira.coreos.com/browse/QUAY-910
This commit is contained in:
parent
0c1b13828f
commit
861e81cccd
5 changed files with 41 additions and 17 deletions
|
@ -211,11 +211,14 @@ class UserAuthentication(object):
|
|||
"""
|
||||
return self.state.link_user(username_or_email)
|
||||
|
||||
def get_and_link_federated_user_info(self, user_info):
|
||||
def get_and_link_federated_user_info(self, user_info, internal_create=False):
|
||||
""" Returns a tuple containing the database user record linked to the given UserInformation
|
||||
pair and any error that occurred when trying to link the user.
|
||||
|
||||
If `internal_create` is True, the caller is an internal user creation process (such
|
||||
as team syncing), and the "can a user be created" check will be bypassed.
|
||||
"""
|
||||
return self.state.get_and_link_federated_user_info(user_info)
|
||||
return self.state.get_and_link_federated_user_info(user_info, internal_create=internal_create)
|
||||
|
||||
def confirm_existing_user(self, username, password):
|
||||
""" Verifies that the given password matches to the given DB username. Unlike
|
||||
|
|
Reference in a new issue