Skip to content

Commit 7f76bcd

Browse files
author
Robert Dana
committed
fix: Ensure group_id consistency for tags/tools
Adds the optional group_id field to RecipeTag and CategoryBase Pydantic schemas to resolve API validation errors (TypeError/IntegrityError) when updating recipe tags/categories via PATCH or bulk actions. This ensures group_id provided in payloads is not stripped during validation. Also adds the required group_id field to the RecipeToolOut schema. This ensures group_id is present when validating Recipe objects during creation in tests, resolving Pydantic validation errors and downstream IntegrityErrors that occurred during test setup fixtures.
1 parent 6845b51 commit 7f76bcd

File tree

3 files changed

+3
-0
lines changed

3 files changed

+3
-0
lines changed

mealie/schema/recipe/recipe.py

+1
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@
3838

3939
class RecipeTag(MealieModel):
4040
id: UUID4 | None = None
41+
group_id: UUID4 | None = None
4142
name: str
4243
slug: str
4344

mealie/schema/recipe/recipe_category.py

+1
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ class CategorySave(CategoryIn):
1616

1717
class CategoryBase(CategoryIn):
1818
id: UUID4
19+
group_id: UUID4 | None = None
1920
slug: str
2021
model_config = ConfigDict(from_attributes=True)
2122

mealie/schema/recipe/recipe_tool.py

+1
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ class RecipeToolSave(RecipeToolCreate):
1717

1818
class RecipeToolOut(RecipeToolCreate):
1919
id: UUID4
20+
group_id: UUID4
2021
slug: str
2122

2223
model_config = ConfigDict(from_attributes=True)

0 commit comments

Comments
 (0)