diff --git a/app/controllers/admin/terms_of_service_files_controller.rb b/app/controllers/admin/terms_of_service_files_controller.rb index e3cc71a9db..38805526e9 100644 --- a/app/controllers/admin/terms_of_service_files_controller.rb +++ b/app/controllers/admin/terms_of_service_files_controller.rb @@ -15,6 +15,9 @@ module Admin def create TermsOfServiceFile.create!(file_params) redirect_to main_app.admin_terms_of_service_files_path + rescue ActionController::ParameterMissing + flash[:error] = t(".select_file") + redirect_to main_app.admin_terms_of_service_files_path end def destroy diff --git a/config/locales/en.yml b/config/locales/en.yml index ba909aabd1..a1934c45c0 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -449,6 +449,8 @@ en: embedded_shopfronts_whitelist: "External Domains Whitelist" terms_of_service_files: + create: + select_file: "Please select a file first." show: title: "Terms of Service files" no_files: "No terms of services have been uploaded yet."