Skip to content

Commit

Permalink
Merge pull request #5345 from PanSpagetka/bz1687946
Browse files Browse the repository at this point in the history
Don't throw exception when template is not found in Provisioning

(cherry picked from commit e7b0336)

Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1693740
  • Loading branch information
mzazrivec authored and simaishi committed Mar 29, 2019
1 parent abe9280 commit 2bffa02
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions app/controllers/application_controller/miq_request_methods.rb
Expand Up @@ -25,11 +25,12 @@ def prov_field_changed
refresh_divs = prov_get_form_vars # Get changed option, returns true if divs need refreshing
build_grid if refresh_divs
changed = (@edit[:new] != @edit[:current])
@record = if @edit[:new][:src_configured_system_ids].present?
PhysicalServer.find(@edit[:new][:src_configured_system_ids].first)
elsif @edit[:new][:src_vm_id].first.present?
MiqTemplate.find(@edit[:new][:src_vm_id].first)
end
@record =
if @edit[:new][:src_configured_system_ids].present?
PhysicalServer.where(:id => @edit[:new][:src_configured_system_ids].first).first
elsif @edit[:new][:src_vm_id].first.present?
MiqTemplate.where(:id => @edit[:new][:src_vm_id].first).first
end
render :update do |page|
page << javascript_prologue
# Going thru all dialogs to see if model has set any of the dialog display to hide/ignore
Expand Down

0 comments on commit 2bffa02

Please sign in to comment.