change layout settings for lebensmittel
This commit is contained in:
+7
-1
@@ -2906,12 +2906,16 @@ def sync_item_set_items(set_id: int, item_ids: list[int]) -> None:
|
||||
|
||||
def extract_item_set_form_data(existing: dict | None = None) -> dict:
|
||||
form_data = existing or {}
|
||||
item_ids = [int(value) for value in request.form.getlist("item_ids") if value.isdigit()]
|
||||
remove_item_id = request.form.get("remove_item_id", "").strip()
|
||||
if remove_item_id.isdigit():
|
||||
item_ids = [item_id for item_id in item_ids if item_id != int(remove_item_id)]
|
||||
form_data.update(
|
||||
{
|
||||
"name": request.form.get("name", "").strip(),
|
||||
"description": request.form.get("description", "").strip(),
|
||||
"visibility": normalize_visibility(request.form.get("visibility"), form_data.get("visibility", "shared")),
|
||||
"item_ids": [int(value) for value in request.form.getlist("item_ids") if value.isdigit()],
|
||||
"item_ids": item_ids,
|
||||
"item_search": request.form.get("item_search", "").strip(),
|
||||
}
|
||||
)
|
||||
@@ -3441,6 +3445,7 @@ def item_set_create():
|
||||
visibility_options=VISIBILITY_FORM_OPTIONS,
|
||||
name_suggestions=ITEM_SET_NAME_SUGGESTIONS,
|
||||
item_groups=group_items_by_availability(items),
|
||||
selected_items=fetch_items_by_ids(form_data["item_ids"]),
|
||||
)
|
||||
|
||||
|
||||
@@ -3491,6 +3496,7 @@ def item_set_edit(set_id: int):
|
||||
visibility_options=VISIBILITY_FORM_OPTIONS,
|
||||
name_suggestions=ITEM_SET_NAME_SUGGESTIONS,
|
||||
item_groups=group_items_by_availability(items),
|
||||
selected_items=fetch_items_by_ids(form_data["item_ids"]),
|
||||
)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user