Skip to content

Commit

Permalink
(PC-31043)[API] fix: undo making native category nullable
Browse files Browse the repository at this point in the history
  • Loading branch information
thconte committed Sep 26, 2024
1 parent 8c295a9 commit 418bfc1
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions api/src/pcapi/core/categories/subcategories_v2.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit 418bfc1

Please sign in to comment.