Jinja2 condition not working anymore in Custom Link URL field #12694
Labels
status: accepted
This issue has been accepted for implementation
type: bug
A confirmed report of unexpected behavior in the application
NetBox version
v3.5.2
Python version
3.9
Steps to Reproduce
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:
![netbox_sanitize_url](https://private-user-images.githubusercontent.com/57258906/240562586-cfac89b3-8b1a-4770-abec-c99a3cffc9ef.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjEyNDI0OTQsIm5iZiI6MTcyMTI0MjE5NCwicGF0aCI6Ii81NzI1ODkwNi8yNDA1NjI1ODYtY2ZhYzg5YjMtOGIxYS00NzcwLWFiZWMtYzk5YTNjZmZjOWVmLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA3MTclMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwNzE3VDE4NDk1NFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWVjZWMzN2FkZWExMGI2YjkxMTMyMWZmOTNjOWU0ZDEwNjQ1NzkzZjhlMTVmOWVlZjdkYjM2NGQzM2JmNjIxMTAmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.I3ZmoOuS6wl_5NVLJACUQU50wwY4LSg5TeNpRs-S70U)
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.
The text was updated successfully, but these errors were encountered: