diff --git a/itou/users/management/commands/new_users_to_brevo.py b/itou/users/management/commands/new_users_to_brevo.py index b2cce75556..7f535a3054 100644 --- a/itou/users/management/commands/new_users_to_brevo.py +++ b/itou/users/management/commands/new_users_to_brevo.py @@ -114,7 +114,9 @@ def handle(self, *args, wet_run, **options): verified=True, ) ) - | Q(identity_provider=IdentityProvider.INCLUSION_CONNECT), # IC verifies emails on its own + | Q( + identity_provider__in=[IdentityProvider.INCLUSION_CONNECT, IdentityProvider.PRO_CONNECT] + ), # the SSO verifies emails on its own is_active=True, ) .order_by("email") diff --git a/tests/users/test_management_commands.py b/tests/users/test_management_commands.py index 7deee994e4..521181b000 100644 --- a/tests/users/test_management_commands.py +++ b/tests/users/test_management_commands.py @@ -373,7 +373,7 @@ def test_wet_run_siae(self, caplog, respx_mock): # Job seekers are ignored. JobSeekerFactory(with_verified_email=True) for kind in set(CompanyKind) - set(SIAE_WITH_CONVENTION_KINDS): - CompanyMembershipFactory(company__kind=kind, user__identity_provider=IdentityProvider.INCLUSION_CONNECT) + CompanyMembershipFactory(company__kind=kind, user__identity_provider=IdentityProvider.PRO_CONNECT) # Missing verified email and not using IC CompanyMembershipFactory(company__kind=CompanyKind.EI, user__identity_provider=IdentityProvider.DJANGO) not_primary = CompanyMembershipFactory( @@ -397,31 +397,31 @@ def test_wet_run_siae(self, caplog, respx_mock): first_name="Annie", last_name="Amma", email="annie.amma@mailinator.com", - identity_provider=IdentityProvider.INCLUSION_CONNECT, + identity_provider=IdentityProvider.PRO_CONNECT, ) bob = EmployerFactory( first_name="Bob", last_name="Bailey", email="bob.bailey@mailinator.com", - identity_provider=IdentityProvider.INCLUSION_CONNECT, + identity_provider=IdentityProvider.PRO_CONNECT, ) cindy = EmployerFactory( first_name="Cindy", last_name="Cinnamon", email="cindy.cinnamon@mailinator.com", - identity_provider=IdentityProvider.INCLUSION_CONNECT, + identity_provider=IdentityProvider.PRO_CONNECT, ) dave = EmployerFactory( first_name="Dave", last_name="Doll", email="dave.doll@mailinator.com", - identity_provider=IdentityProvider.INCLUSION_CONNECT, + identity_provider=IdentityProvider.PRO_CONNECT, ) eve = EmployerFactory( first_name="Eve", last_name="Ebi", email="eve.ebi@mailinator.com", - identity_provider=IdentityProvider.INCLUSION_CONNECT, + identity_provider=IdentityProvider.PRO_CONNECT, ) CompanyMembershipFactory(user=annie, company__kind=CompanyKind.EI) CompanyMembershipFactory(user=bob, company__kind=CompanyKind.AI)