New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add error msg for null file while Adding Commercial for event #1961
Conversation
@@ -57,7 +57,9 @@ def render_commercial | |||
def mass_upload | |||
errors = Commercial.read_file(params[:file]) if params[:file] | |||
|
|||
if errors.all? { |_k, v| v.blank? } | |||
if !errors |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are there any other conditions that could cause an error here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@bear454, is there any problem with this issue or PR? can you please review this :-) ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you misunderstood my question - I read your code as treating any error as a result of a bad file upload; have you considered that other conditions may cause errors ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oh, my bad, now I understand my mistake thanks :-)
Null file error message added for uploading empty file in CommercialsController#mass_upload Closes openSUSE#1959
274b29c
to
0cb5d2c
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
Null file error message added for uploading empty file in CommercialsController#mass_upload
Closes #1959
Checklist
master
branch.Short description of what this resolves/which issues does this fix?: