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
|
def mass_upload
|
||||||
errors = Commercial.read_file(params[:file]) if params[:file]
|
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.'
|
flash[:notice] = 'Successfully added commercials.'
|
||||||
else
|
else
|
||||||
errors_text = ''
|
errors_text = ''
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue