-
-
Notifications
You must be signed in to change notification settings - Fork 750
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[nightly] - Meal Plan Notes allow Submission Without Title/Note Text, but Return 422 #2446
Comments
Ah I see, looks like we need to add validation to the frontend. This is the backend: class CreatePlanEntry(MealieModel):
date: date
entry_type: PlanEntryType = PlanEntryType.breakfast
title: str = ""
text: str = ""
recipe_id: UUID | None
@validator("recipe_id", always=True)
@classmethod
def id_or_title(cls, value, values):
if bool(value) is False and bool(values["title"]) is False:
raise ValueError(f"`recipe_id={value}` or `title={values['title']}` must be provided")
return value |
Fixed by 776d56e |
Adding bug confirmed, based on Michael's comment way back when. |
Bump. Can we get this fix implemented? It seems that the fix is not a part of this repo, but it's ready to use (idk Vue, but looks correct), so it's probably a quick upgrade that fixes pretty annoying bug 👍🏻 |
I've just tested the solution posted here and it doesn't seem to work for me - the UI tells me the field is required but doesn't actually stop me submitting it and hitting the 422 error. |
Getting the same error even on 1.12.0 |
Hi @boc-the-git, I have fixed this issue in this PR |
First Check
What is the issue you are experiencing?
Planning to handle in #2399 but submitting since it may be a little while before I get to it.
Deployment
Docker (Linux)
Deployment Details
No response
The text was updated successfully, but these errors were encountered: