diff --git a/parentcalendar/app.py b/parentcalendar/app.py index 5016472..bb382fe 100644 --- a/parentcalendar/app.py +++ b/parentcalendar/app.py @@ -476,8 +476,9 @@ class MenuItemIn(BaseModel): @app.patch("/api/menu_items/{item_id}") def edit_menu_item(item_id: int, body: MenuItemIn, conn: DB): - """Fix a misread menu day, in review or later.""" - items = [] if body.no_lunch else [i.strip() for i in body.items if i.strip()] + """Fix a misread menu day, in review or after publishing: menus never reach a calendar file, so the + lunch screen shows the change right away. The food is kept when no_lunch is set, so unticking it brings it back.""" + items = [i.strip() for i in body.items if i.strip()] with conn: found(conn.execute("UPDATE menu_item SET items = ?, no_lunch = ?, flags = '[]' WHERE id = ? RETURNING id", (json.dumps(items), body.no_lunch, item_id)).fetchone(), "menu item")