mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-02-27 01:43:22 +00:00
Fix variant filtering
We don't want to filter out variant missing producer, so that the user can address the problem.
This commit is contained in:
@@ -9,7 +9,8 @@
|
||||
|
||||
- product.variants.each_with_index do |variant, variant_index|
|
||||
|
||||
- next unless allowed_producers.include?(variant.supplier)
|
||||
-# Filter out variant a user has not permission to update, but keep variant with no supplier
|
||||
- next if variant.supplier.present? && !allowed_producers.include?(variant.supplier)
|
||||
= form.fields_for("products][#{product_index}][variants_attributes", variant, index: variant_index) do |variant_form|
|
||||
%tr.condensed{ id: dom_id(variant), 'data-controller': "variant", 'class': "nested-form-wrapper", 'data-new-record': variant.new_record? ? "true" : false }
|
||||
= render partial: 'variant_row', locals: { variant:, f: variant_form, category_options:, tax_category_options:, producer_options: }
|
||||
|
||||
Reference in New Issue
Block a user