diff --git a/api/src/pcapi/core/categories/subcategories_v2.py b/api/src/pcapi/core/categories/subcategories_v2.py index e5259510588..34cec92c79d 100644 --- a/api/src/pcapi/core/categories/subcategories_v2.py +++ b/api/src/pcapi/core/categories/subcategories_v2.py @@ -410,6 +410,7 @@ def get_show_nodes() -> list[ShowGenre]: label="Musique en ligne", parents=[SEARCH_GROUP_CD_VINYLE_MUSIQUE_EN_LIGNE.id], ) +NATIVE_CATEGORY_NONE = NativeCategory(technical_name="NO_NATIVE_CATEGORY", label="None", parents=[]) NATIVE_CATEGORY_PARTITIONS_DE_MUSIQUE = NativeCategory( technical_name="PARTITIONS_DE_MUSIQUE", label="Partitions de musique", @@ -655,8 +656,8 @@ def category_id(self) -> str: return self.category.id @property - def native_category_id(self) -> str | None: - return self.native_category.id if self.native_category else None + def native_category_id(self) -> str: + return self.native_category.id @property def is_offline_only(self) -> bool: @@ -1302,7 +1303,7 @@ def is_online_only(self) -> bool: CARTE_JEUNES = Subcategory( id="CARTE_JEUNES", category=categories.CARTE_JEUNES, - native_category=None, + native_category=NATIVE_CATEGORY_NONE, pro_label="Carte jeunes", app_label="Carte jeunes", search_group_name=SEARCH_GROUP_CARTES_JEUNES.id,