mirror of
https://github.com/netbox-community/netbox.git
synced 2025-07-29 03:46:25 -06:00
Fixes #17490: Config Template unable to dynamically include templates
This commit is contained in:
parent
9c7f2ec98c
commit
9f45300999
@ -29,10 +29,16 @@ class DataFileLoader(BaseLoader):
|
|||||||
|
|
||||||
# Find and pre-fetch referenced templates
|
# Find and pre-fetch referenced templates
|
||||||
if referenced_templates := find_referenced_templates(environment.parse(template_source)):
|
if referenced_templates := find_referenced_templates(environment.parse(template_source)):
|
||||||
self.cache_templates({
|
if None in referenced_templates:
|
||||||
df.path: df.data_as_string for df in
|
self.cache_templates({
|
||||||
DataFile.objects.filter(source=self.data_source, path__in=referenced_templates)
|
df.path: df.data_as_string for df in
|
||||||
})
|
DataFile.objects.filter(source=self.data_source)
|
||||||
|
})
|
||||||
|
else:
|
||||||
|
self.cache_templates({
|
||||||
|
df.path: df.data_as_string for df in
|
||||||
|
DataFile.objects.filter(source=self.data_source, path__in=referenced_templates)
|
||||||
|
})
|
||||||
|
|
||||||
return template_source, template, lambda: True
|
return template_source, template, lambda: True
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user