mirror of
https://github.com/mealie-recipes/mealie.git
synced 2026-02-16 12:53:12 -05:00
feat: sort by labels in shopping list copy if labels toggled (#3226)
* feat: sort by labels in shopping list copy if labels toggled * fix: call parent validator in shopping list item out (#3227) * fix: add a unit test for (#3227) * fixed messy post_validate logic * feat: label headings in shopping list copy * feat: blank line for each group in shopping list copy --------- Co-authored-by: Michael Genson <71845777+michael-genson@users.noreply.github.com>
This commit is contained in:
@@ -101,7 +101,7 @@ class ShoppingListItemOut(ShoppingListItemBase):
|
||||
update_at: datetime | None = None
|
||||
|
||||
@model_validator(mode="after")
|
||||
def post_validate(self):
|
||||
def populate_missing_label(self):
|
||||
# if we're missing a label, but the food has a label, use that as the label
|
||||
if (not self.label) and (self.food and self.food.label):
|
||||
self.label = self.food.label
|
||||
|
||||
Reference in New Issue
Block a user