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

show error message when deleting router #2737

Merged

Conversation

alexander-demicev
Copy link

Router is not deleted if delete action is not supported and shows error message
Fixes this BZ https://bugzilla.redhat.com/show_bug.cgi?id=1470754

@@ -167,6 +167,8 @@ def delete_network_routers
router = NetworkRouter.find_by(:id => s)
if router.nil?
add_flash(_("Router no longer exists."), :error)
elsif !router.supports?(:delete)
add_flash(_("%{reason}") % {:reason => router.unsupported_reason(:delete)}, :error)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd say, as long as router.unsupported_reason(:delete) returns a string, you can just as well use:

add_flash(_(router.unsupported_reason(:delete)), :error)

@miq-bot
Copy link
Member

miq-bot commented Nov 22, 2017

Checked commit alexander-demicev@4f56bed with ruby 2.3.3, rubocop 0.47.1, haml-lint 0.20.0, and yamllint 1.10.0
1 file checked, 0 offenses detected
Everything looks fine. ⭐

@alexander-demicev
Copy link
Author

alexander-demicev commented Nov 22, 2017

@mzazrivec Hi, related PR is merged. Can I ask you to review this again?

@chessbyte chessbyte added the bug label Nov 24, 2017
@mzazrivec mzazrivec self-assigned this Nov 27, 2017
@mzazrivec mzazrivec added this to the Sprint 74 Ending Nov 27, 2017 milestone Nov 27, 2017
@mzazrivec mzazrivec merged commit 5f80d1d into ManageIQ:master Nov 27, 2017
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.

4 participants