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,6 +29,12 @@ class DataFileLoader(BaseLoader):
|
||||
|
||||
# Find and pre-fetch referenced templates
|
||||
if referenced_templates := find_referenced_templates(environment.parse(template_source)):
|
||||
if None in referenced_templates:
|
||||
self.cache_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)
|
||||
|
Loading…
Reference in New Issue
Block a user