From feeb1dcb692ff0c57f41254a144c261fca38d8a2 Mon Sep 17 00:00:00 2001 From: Henry Date: Tue, 23 Jan 2024 10:49:53 -0500 Subject: [PATCH 1/2] fix the address check --- app/services/identity_service.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/services/identity_service.rb b/app/services/identity_service.rb index b9d8f8570..4fccafeee 100644 --- a/app/services/identity_service.rb +++ b/app/services/identity_service.rb @@ -135,7 +135,7 @@ def self.create_identity_from_clyde(details:) # if there is a person with this as primary email AND no OAuth Clyde identity # then we will error out - as they should login with Plano and link instead - raise "Person already exists with that email" if addr.count > 0 + raise "Person already exists with that email" if addr && addr.count > 0 # Otherwise we create a new person, if the email is already used as prime we can not set it as the default person = create_person_from_clyde(details: details, identity: identity, email_is_default: addr.nil?) From 986f41a2c52e4e779ad9f8e7a0ab9ae9cdd912bb Mon Sep 17 00:00:00 2001 From: Henry Date: Tue, 23 Jan 2024 11:04:50 -0500 Subject: [PATCH 2/2] fix address check --- app/services/identity_service.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/services/identity_service.rb b/app/services/identity_service.rb index 4fccafeee..f14a5f2b4 100644 --- a/app/services/identity_service.rb +++ b/app/services/identity_service.rb @@ -135,7 +135,7 @@ def self.create_identity_from_clyde(details:) # if there is a person with this as primary email AND no OAuth Clyde identity # then we will error out - as they should login with Plano and link instead - raise "Person already exists with that email" if addr && addr.count > 0 + raise "Person already exists with that email" if addr # Otherwise we create a new person, if the email is already used as prime we can not set it as the default person = create_person_from_clyde(details: details, identity: identity, email_is_default: addr.nil?)