GRN2-138: Fixed issue with admin rake task (#521)

* Fixed issue with admin rake task

* rspec
This commit is contained in:
farhatahmad
2019-05-17 12:49:42 -04:00
committed by Jesus Federico
parent 4a4fcec6fb
commit c3ddb17514
5 changed files with 2 additions and 24 deletions

View File

@ -78,8 +78,6 @@ module ApplicationHelper
def allow_greenlight_accounts?
return Rails.configuration.allow_user_signup unless Rails.configuration.loadbalanced_configuration
return false unless @user_domain && !@user_domain.empty? && Rails.configuration.allow_user_signup
# No need to retrieve the provider info if the provider is whitelisted
return true if launcher_allow_user_signup_whitelisted?(@user_domain)
# Proceed with retrieving the provider info
begin
provider_info = retrieve_provider_info(@user_domain, 'api2', 'getUserGreenlightCredentials')

View File

@ -200,9 +200,8 @@ class User < ApplicationRecord
def greenlight_account?
return true unless provider # For testing cases when provider is set to null
return provider == "greenlight" unless Rails.configuration.loadbalanced_configuration
# No need to retrive the provider info if the provider is whitelisted
return true if launcher_allow_user_signup_whitelisted?(provider)
return true if provider == "greenlight"
return false unless Rails.configuration.loadbalanced_configuration
# Proceed with fetching the provider info
provider_info = retrieve_provider_info(provider, 'api2', 'getUserGreenlightCredentials')
provider_info['provider'] == 'greenlight'