-
Notifications
You must be signed in to change notification settings - Fork 358
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
Reset selected snapshot in session when deleting the snapshot #183
Reset selected snapshot in session when deleting the snapshot #183
Conversation
@miq-bot add_label bug |
@h-kataria please review. |
@@ -1874,6 +1874,12 @@ def vm_button_operation(method, display_name, partial_after_single_selection = n | |||
@single_delete = true unless flash_errors? | |||
end | |||
|
|||
# Reset session[:snap_selected] if that snapshot is being deleted | |||
if method == 'remove_snapshot' && session[:snap_selected].present? && | |||
Snapshot.find(session[:snap_selected]).vm_or_template_id.to_s == params[:id] |
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.
@bmclaughlin can't we just check for existence of Snapshot record here like this: Snapshot.find_by_id(session[:snap_selected]).nil?
@h-kataria, ready for another review. |
@bmclaughlin your PR solves #209 as well :) |
06981ed
to
636ea9f
Compare
changes looks good. |
636ea9f
to
7962ae0
Compare
Checked commits bmclaughlin/manageiq-ui-classic@722bd2c~...7962ae0 with ruby 2.2.6, rubocop 0.47.1, and haml-lint 0.20.0 |
@bmclaughlin There is a conflict in backporting to Euwe for the spec file. Can you create an Euwe PR? |
Backported to Euwe via ManageIQ/manageiq#14361 |
Fixes an error in the logs and the page not loading when the currently selected snapshot is deleted and attempting to view the Snapshot Summary page.
Closes #209
https://bugzilla.redhat.com/show_bug.cgi?id=1395116