mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-01-24 20:36:49 +00:00
Only add variant override permission if inventory enabled
The permission shoul not be needed if inventory is disabled, but it will prevent importing into the inventory if somehow we try to import into inventory with inventory disabled.
This commit is contained in:
@@ -193,6 +193,8 @@ module ProductImport
|
||||
order('is_primary_producer ASC, name').
|
||||
map { |e| @editable_enterprises[e.name] = e.id }
|
||||
|
||||
return unless OpenFoodNetwork::FeatureToggle.enabled?(:inventory, @current_user.enterprises)
|
||||
|
||||
@inventory_permissions = permissions.variant_override_enterprises_per_hub
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user