From 071df531341025b2c6598438a3cd82fdcc65b945 Mon Sep 17 00:00:00 2001 From: Adam Ruzicka Date: Thu, 31 Oct 2024 13:05:54 +0000 Subject: [PATCH] Fixes #37962 - Check template requirements before import To prevent importing templates which don't have their requirements met. --- app/models/job_template.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/app/models/job_template.rb b/app/models/job_template.rb index 60d9f59db..818d10d99 100644 --- a/app/models/job_template.rb +++ b/app/models/job_template.rb @@ -64,6 +64,7 @@ def base_class # will overwrite (sync) an existing template if options[:update] is true. def import_raw(contents, options = {}) metadata = Template.parse_metadata(contents) + return unless SeedHelper.test_template_requirements(metadata['name'], metadata['require'] || []) import_parsed(metadata['name'], contents, metadata, options) end