mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-03-06 02:51:34 +00:00
Merge pull request #9911 from viniciusueharaweb/9781-improve-shipping-category-not-found-error-message
[Product Import] Wrong error message when shipping category does not match predefined shipping categories
This commit is contained in:
@@ -299,7 +299,7 @@ module ProductImport
|
||||
entry.public_send("#{type}_category_id=", index[category])
|
||||
else
|
||||
mark_as_invalid(entry, attribute: "#{type}_category",
|
||||
error: I18n.t('admin.product_import.model.not_found'))
|
||||
error: I18n.t('admin.product_import.model.category_not_found'))
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
@@ -68,7 +68,7 @@ module ProductImport
|
||||
|
||||
def invalid_attributes
|
||||
invalid_attrs = {}
|
||||
errors = @product_validations ? self.errors.messages.merge(@product_validations.messages) : self.errors.messages
|
||||
errors = @product_validations ? @product_validations.messages.merge(self.errors.messages) : self.errors.messages
|
||||
errors.each do |attr, message|
|
||||
invalid_attrs[attr.to_s] = "#{attr.to_s.capitalize} #{message.first}"
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user