diff --git a/itou/siaes/management/commands/import_siae.py b/itou/siaes/management/commands/import_siae.py index 810815b7d9..65fc00f0ca 100755 --- a/itou/siaes/management/commands/import_siae.py +++ b/itou/siaes/management/commands/import_siae.py @@ -108,7 +108,7 @@ def update_siae_siret(self, siae, new_siret): def update_siret_and_auth_email_of_existing_siaes(self): auth_email_updates = 0 for siae in Siae.objects.select_related("convention").filter(source=Siae.SOURCE_ASP, convention__isnull=False): - assert siae.kind in Siae.ELIGIBILITY_REQUIRED_KINDS + assert siae.is_subject_to_eligibility_rules asp_id = siae.asp_id row = ASP_ID_TO_SIAE_ROW.get(asp_id) @@ -189,7 +189,7 @@ def create_new_siaes(self): # Siaes with this asp_id already exist, no need to create one more. total_existing_siae_with_asp_source = 0 for existing_siae in existing_siae_query.all(): - assert existing_siae.kind in Siae.ELIGIBILITY_REQUIRED_KINDS + assert existing_siae.is_subject_to_eligibility_rules if existing_siae.source == Siae.SOURCE_ASP: total_existing_siae_with_asp_source += 1 if not self.dry_run: @@ -210,7 +210,7 @@ def create_new_siaes(self): assert self.dry_run continue assert existing_siae.source in [Siae.SOURCE_USER_CREATED, Siae.SOURCE_STAFF_CREATED] - assert existing_siae.kind in Siae.ELIGIBILITY_REQUIRED_KINDS + assert existing_siae.is_subject_to_eligibility_rules self.log( f"siae.id={existing_siae.id} already exists " f"with wrong source={existing_siae.source} " diff --git a/itou/siaes/models.py b/itou/siaes/models.py index 0085dd3f2a..3afbbebbdb 100644 --- a/itou/siaes/models.py +++ b/itou/siaes/models.py @@ -215,7 +215,7 @@ def display_name(self): @property def is_active(self): - if self.kind not in Siae.ELIGIBILITY_REQUIRED_KINDS: + if not self.is_subject_to_eligibility_rules: # GEIQ, EA... have no convention logic and thus are always active. return True if self.source in [Siae.SOURCE_USER_CREATED, Siae.SOURCE_STAFF_CREATED]: