[PR #18106] [MERGED] Fixes #17490: Config Template unable to dynamically include templates #15274

Closed
opened 2025-12-30 00:21:00 +01:00 by adam · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/netbox-community/netbox/pull/18106
Author: @robduffy2010
Created: 11/26/2024
Status: Merged
Merged: 12/5/2024
Merged by: @jeremystretch

Base: developHead: 17490-fix-dynamically-including-templates


📝 Commits (4)

  • 9f45300 Fixes #17490: Config Template unable to dynamically include templates
  • 9930fef Cast the generator returned by find_referenced_templates() to an iterable to avoid exhausting it on the check for None
  • 5173a49 Apply the path__in filter to avoid duplicating code
  • 20c0235 Remove extra if None not in referenced_templates

📊 Changes

1 file changed (+7 additions, -3 deletions)

View changed files

📝 netbox/utilities/jinja2.py (+7 -3)

📄 Description

Fixes: #17490

Config templates are unable to dynamically include child templates. This is a proposed fix as suggested by @ed-ud in #18066 which was closed as a duplicate.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/netbox-community/netbox/pull/18106 **Author:** [@robduffy2010](https://github.com/robduffy2010) **Created:** 11/26/2024 **Status:** ✅ Merged **Merged:** 12/5/2024 **Merged by:** [@jeremystretch](https://github.com/jeremystretch) **Base:** `develop` ← **Head:** `17490-fix-dynamically-including-templates` --- ### 📝 Commits (4) - [`9f45300`](https://github.com/netbox-community/netbox/commit/9f453009999922a4589c6289cd61866acf74afcb) Fixes #17490: Config Template unable to dynamically include templates - [`9930fef`](https://github.com/netbox-community/netbox/commit/9930fef28b152d431544998847a2b4a1d23e9d9a) Cast the generator returned by find_referenced_templates() to an iterable to avoid exhausting it on the check for None - [`5173a49`](https://github.com/netbox-community/netbox/commit/5173a490b827ccf12b117acbf44f9cd7beda2c63) Apply the path__in filter to avoid duplicating code - [`20c0235`](https://github.com/netbox-community/netbox/commit/20c02350065712e7fe75904a3a6697884abbb670) Remove extra if None not in referenced_templates ### 📊 Changes **1 file changed** (+7 additions, -3 deletions) <details> <summary>View changed files</summary> 📝 `netbox/utilities/jinja2.py` (+7 -3) </details> ### 📄 Description ### Fixes: #17490 Config templates are unable to dynamically include child templates. This is a proposed fix as suggested by @ed-ud in #18066 which was closed as a duplicate. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
adam added the pull-request label 2025-12-30 00:21:00 +01:00
adam closed this issue 2025-12-30 00:21:01 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#15274