Add feature flag to disable username confirmation

Fixes https://jira.coreos.com/browse/QUAY-914
This commit is contained in:
Joseph Schorr 2018-06-01 13:24:29 -04:00
parent 81ea73ce0d
commit b2262eaf46
8 changed files with 33 additions and 3 deletions

View file

@ -392,7 +392,8 @@ class User(ApiResource):
new_username = user_data.get('username')
previous_username = user.username
rename_allowed = features.USER_RENAME or confirm_username
rename_allowed = (features.USER_RENAME or
(confirm_username and features.USERNAME_CONFIRMATION))
username_changing = new_username and new_username != previous_username
if rename_allowed and username_changing:

View file

@ -110,6 +110,7 @@ def _conduct_oauth_login(auth_system, login_service, lid, lusername, lemail, met
user_obj = model.user.create_federated_user(new_username, lemail, service_id, lid,
set_password_notification=requires_password,
metadata=metadata or {},
confirm_username=features.USERNAME_CONFIRMATION,
prompts=prompts,
email_required=features.MAILING)