Skip to content

Commit

Permalink
Don't throw exception when template is not found in Provisioning
Browse files Browse the repository at this point in the history
  • Loading branch information
PanSpagetka committed Mar 15, 2019
1 parent 56ea97a commit d62afba
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions app/controllers/application_controller/miq_request_methods.rb
Expand Up @@ -25,11 +25,14 @@ 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 = begin
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
rescue ActiveRecord::RecordNotFound
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 d62afba

Please sign in to comment.