UX: Return a friendlier error when the CSV is invalid. Added a cancel button to return to the /badges view

This commit is contained in:
romanrizzi
2020-01-13 15:53:41 -03:00
parent e4a85e2a80
commit d3091edcea
3 changed files with 8 additions and 1 deletions

View File

@ -64,7 +64,7 @@ class Admin::BadgesController < Admin::AdminController
head :ok
rescue CSV::MalformedCSVError
raise Discourse::InvalidParameters
render_json_error I18n.t('badges.mass_award.errors.invalid_csv'), status: 400
end
def badge_types