Fix snail when editing enterprise fees

This commit is contained in:
mariodz95
2021-10-19 10:26:44 +02:00
parent 10fe61b71f
commit 578efa945e
2 changed files with 8 additions and 1 deletions

View File

@@ -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

View File

@@ -174,7 +174,7 @@ en_US:
userguide: "Open Food Network User Guide"
email_admin_html: "You can manage your account by logging into the %{link} or by clicking on the person shape in the top right hand side of the homepage, and selecting \"Administration\" from the dropdown."
admin_panel: "Admin Panel"
email_community_html: "We'll leave you to explore the platform and our community (%{link}) for now and will check back in tomorrow with more information and resources! In the meantime, please make sure emails from addresses at openfoodnetwork.net aren't intercepted by your spam filter. Once again, welcome to our community, we're glad you are here!"
email_community_html: "We'll leave you to explore the platform and our community for now and will check back in soon with more information and resources! In the meantime, please make sure emails from addresses at openfoodnetwork.net aren't intercepted by your spam filter. If you have any questions at all, please don't hesitate to contact us at support-usa@openfoodnetwork.net. Once again, welcome to our community, we're glad you are here!"
join_community: "Join the community"
invite_manager:
subject: "%{enterprise} has invited you to be a manager"