Skip to content

Commit

Permalink
Fixes #37986, #37982 - Fix UI Error when importing templates
Browse files Browse the repository at this point in the history
Importing templates through UI causes an error and the page with import
results does not load.

Steps to Reproduce:

1. Have foreman instance with the templates plugin on nightly (error
originates in one of the newest commits so it is not on stream yet).

2. Navigate to Hosts > Templates > Sync Templates

3. Import templates from
https://github.com/theforeman/community-templates.git

Actual behavior:

The page with results does not load and two popups are displayed. One
saying that templates have been imported succesfully and another saying
that there has been an error.

Expected behavior:

Page with results loads normally and displays templates correctly.
  • Loading branch information
adamlazik1 committed Nov 6, 2024
1 parent aff0e8e commit 5081835
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions app/services/foreman_templates/parse_result.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,7 @@ def to_h(verbose = false)
end

def errors
@template&.errors&.messages&.transform_values do |v|
v.join(', ')
end
@template&.errors&.messages || {}
end

def corrupted_metadata
Expand Down

0 comments on commit 5081835

Please sign in to comment.