fix: #6802 prevent 500 internal server error when patching recipe tags#6803
Open
SimeonSouttar wants to merge 3 commits intomealie-recipes:mealie-nextfrom
Open
fix: #6802 prevent 500 internal server error when patching recipe tags#6803SimeonSouttar wants to merge 3 commits intomealie-recipes:mealie-nextfrom
SimeonSouttar wants to merge 3 commits intomealie-recipes:mealie-nextfrom
Conversation
…ing recipe tags
michael-genson
requested changes
Dec 30, 2025
Collaborator
michael-genson
left a comment
There was a problem hiding this comment.
Thanks for this! A couple small things:
- Is it possible to move this to the recipe repo instead of the service? That way we can fix this for updates as well as patches
- Can we do this for categories/tools too? I'm guessing it's the same issue.
- Can we move the test to
tests/unit_tests/repository_tests/test_recipe_repository.py? (assuming we move the functionality to the repo)
6 tasks
SimeonSouttar
commented
Jan 11, 2026
Author
SimeonSouttar
left a comment
There was a problem hiding this comment.
@michael-genson updated inline with your previous comments
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
fix: #6802 prevent 500 internal server error when patching recipe tags
What this PR does / why we need it:
This PR fixes a 500 Internal Server Error
(TypeError: init() missing 1 required positional argument: 'group_id')that occurs when patching a recipe with new tags via the API.The issue was caused by
RecipeService.patch_onenot injecting the current user's group_id into new tags before attempting to update the recipe. The Tag ORM model requires group_id for initialization, but this field is typically excluded from the RecipeTag Pydantic model during patch operations (whereexclude_unset=Trueis used).Changes:
patch_data.tags(if present) and explicitly injectself.user.group_idinto any tag that needs it.Which issue(s) this PR fixes:
Testing
I have added a new integration test case to reproduce the bug and verify the fix.
New Test: tests/integration_tests/user_recipe_tests/test_issue_6802_patch_tags.py
Verification: Ran the test locally with Python 3.12.
Command:
pytest tests/integration_tests/user_recipe_tests/test_issue_6802_patch_tags.pyResult: PASSED