mirror of
https://github.com/netbox-community/netbox.git
synced 2025-07-19 17:59:11 -06:00
Fixes #12115: Fix rendering config templates from a data file
This commit is contained in:
parent
bd38b50e5e
commit
6a85c5b3ce
@ -75,6 +75,7 @@ Two new webhook trigger events have been introduced: `job_start` and `job_end`.
|
|||||||
* [#12108](https://github.com/netbox-community/netbox/issues/12108) - Limit the draggable area of widgets to their headers
|
* [#12108](https://github.com/netbox-community/netbox/issues/12108) - Limit the draggable area of widgets to their headers
|
||||||
* [#12109](https://github.com/netbox-community/netbox/issues/12109) - Fix migration error when replicating more than 100 job results
|
* [#12109](https://github.com/netbox-community/netbox/issues/12109) - Fix migration error when replicating more than 100 job results
|
||||||
* [#12112](https://github.com/netbox-community/netbox/issues/12112) - Do not link data source URL for local paths
|
* [#12112](https://github.com/netbox-community/netbox/issues/12112) - Do not link data source URL for local paths
|
||||||
|
* [#12115](https://github.com/netbox-community/netbox/issues/12115) - Fix rendering config templates from a data file
|
||||||
|
|
||||||
### Other Changes
|
### Other Changes
|
||||||
|
|
||||||
|
@ -245,6 +245,9 @@ class ConfigTemplate(SyncedDataMixin, ExportTemplatesMixin, TagsMixin, ChangeLog
|
|||||||
|
|
||||||
# Initialize the Jinja2 environment and instantiate the Template
|
# Initialize the Jinja2 environment and instantiate the Template
|
||||||
environment = self._get_environment()
|
environment = self._get_environment()
|
||||||
|
if self.data_file:
|
||||||
|
template = environment.get_template(self.data_file.path)
|
||||||
|
else:
|
||||||
template = environment.from_string(self.template_code)
|
template = environment.from_string(self.template_code)
|
||||||
output = template.render(**context)
|
output = template.render(**context)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user