Skip to content
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

Fix error flash messages when creating tasks #4589

Conversation

mzazrivec
Copy link
Contributor

In several places in our code we use the following logic:

task_id = ems.create_some_kind_of_queue(session[:userid], options)
unless task_id.kind_of?(Integer)
  add_flash(_("Some kind of creation failed: Task start failed: ID [%{id}]") % {:id => task_id.to_s}, :error)
end

This is obviously incorrect: since task creation failed, task_id is not an integer and we cannot treat it as integer in the flash error message.

@martinpovolny

Since the task creation failed, we cannot treat task_id as an integer.
Since task creation failed, we cannot treat task_id as an integer.
Since the task creation failed, we cannot treat task_id as integer.
Since task creation failed, we cannot treat task_id as integer.
Since task creation failed, we cannot treat task_id as integer.
Since task creation failed, we cannot treat task_id as integer.
Since task creation failed, we cannot treat task_id as integer.
Since task creation failed, we cannot treat task_id as integer.
Since task creation failed, we cannot treat task_id as integer.
Since task creation failed, we cannot treat task_id as integer.
Since task creation failed, we cannot treat task_id as integer.
@mzazrivec mzazrivec force-pushed the fix_error_flash_msgs_when_creating_tasks branch from bb576bf to c7725ff Compare September 4, 2018 14:04
@miq-bot
Copy link
Member

miq-bot commented Sep 4, 2018

Checked commits mzazrivec/manageiq-ui-classic@3cb5909~...c7725ff with ruby 2.3.3, rubocop 0.52.1, haml-lint 0.20.0, and yamllint 1.10.0
12 files checked, 0 offenses detected
Everything looks fine. 🏆

@martinpovolny martinpovolny self-assigned this Sep 4, 2018
@martinpovolny
Copy link

Right. Make sense 👍

@martinpovolny martinpovolny merged commit a58a44a into ManageIQ:master Sep 5, 2018
@martinpovolny martinpovolny added this to the Sprint 94 Ending Sep 10, 2018 milestone Sep 5, 2018
@mzazrivec mzazrivec deleted the fix_error_flash_msgs_when_creating_tasks branch September 6, 2018 05:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants