mirror of
https://github.com/openSUSE/osem.git
synced 2026-08-13 19:54:02 +00:00
Add error msg for null file while Adding Commercial for event
Null file error message added for uploading empty file in CommercialsController#mass_upload Closes #1959
This commit is contained in:
parent
59f6d94366
commit
913210347f
1 changed files with 3 additions and 1 deletions
|
|
@ -57,7 +57,9 @@ module Admin
|
|||
def mass_upload
|
||||
errors = Commercial.read_file(params[:file]) if params[:file]
|
||||
|
||||
if errors.all? { |_k, v| v.blank? }
|
||||
if !params[:file]
|
||||
flash[:error] = 'Empty file detected while adding commercials to Event'
|
||||
elsif errors.all? { |_k, v| v.blank? }
|
||||
flash[:notice] = 'Successfully added commercials.'
|
||||
else
|
||||
errors_text = ''
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue