mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-02-05 22:26:07 +00:00
Merge pull request #8308 from mariodz95/8250_fix_snail_when_editing_non_numeric_characters_on_enterprise_fees
Fix snail when editing non numeric characters on enterprise fees
This commit is contained in:
@@ -35,6 +35,13 @@ module Admin
|
||||
end
|
||||
|
||||
def bulk_update
|
||||
@flat_percent_value = enterprise_fee_bulk_params.dig('collection_attributes', '0', 'calculator_attributes', 'preferred_flat_percent')
|
||||
|
||||
unless @flat_percent_value.nil? || Float(@flat_percent_value, exception: false)
|
||||
flash[:error] = I18n.t(:calculator_preferred_value_error)
|
||||
return redirect_to redirect_path
|
||||
end
|
||||
|
||||
@enterprise_fee_set = Sets::EnterpriseFeeSet.new(enterprise_fee_bulk_params)
|
||||
|
||||
if @enterprise_fee_set.save
|
||||
|
||||
Reference in New Issue
Block a user