-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Closed
Labels
status: acceptedThis issue has been accepted for implementationThis issue has been accepted for implementationtype: bugA confirmed report of unexpected behavior in the applicationA confirmed report of unexpected behavior in the application
Description
NetBox version
v3.5.2
Python version
3.9
Steps to Reproduce
- Create a custom link with jinja2 condition in "Link URL" field. For example, I set a new Custom Link named "website" with the following on the Link URL field:
{% if object.tenant_id == 1 %}
https://www.google.com
{% else %}
https://www.duckduckgo.com
{% endif %}
Expected Behavior
According to my object tenant id, it should open a webpage on google.com or duduckgo.com when clicking on the custom link button.
Observed Behavior
Instead, I got the following error:

This behaviour seems related to the feature "Sanitize rendered custom link HTML" #12205 .
In fact, when removing the code added in the commit 89fa546, the expected behavior happens.
Thank you for your help.
handisyde and zombah
Metadata
Metadata
Assignees
Labels
status: acceptedThis issue has been accepted for implementationThis issue has been accepted for implementationtype: bugA confirmed report of unexpected behavior in the applicationA confirmed report of unexpected behavior in the application