recipe links

This commit is contained in:
Joren de Graaf
2026-10-23 14:30:58 +02:00
parent 5b986134be
commit 4d76a2bc9c
52 changed files with 2698 additions and 19 deletions
+3 -2
View File
@@ -751,8 +751,9 @@ def _inventory_validation(field, reason):
def _inventory_batch_input(request, data, *, deleting=False):
rows = data.get('item_ids' if deleting else 'items')
if not isinstance(rows, list) or not 1 <= len(rows) <= 20:
raise ValueError('Provide between 1 and 20 inventory items.')
limit = 20 if deleting else 50
if not isinstance(rows, list) or not 1 <= len(rows) <= limit:
raise ValueError(f'Provide between 1 and {limit} inventory items.')
if set(data) - ({'item_ids', 'dry_run', 'atomic', 'confirm'} if deleting else {'items', 'dry_run', 'atomic'}):
raise ValueError('Unknown bulk inventory fields.')
if any(type(data.get(key, default)) is not bool for key, default in (('dry_run', False), ('atomic', False))):