Skip to content

Commit

Permalink
Fixes #12694: Strip leading & trailing whitespace from custom link UR…
Browse files Browse the repository at this point in the history
…L & text
  • Loading branch information
jeremystretch committed May 24, 2023
1 parent b31b086 commit bf1c191
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 4 additions & 0 deletions docs/release-notes/version-3.5.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

## v3.5.3 (FUTURE)

### Bug Fixes

* [#12694](https://github.com/netbox-community/netbox/issues/12694) - Strip leading & trailing whitespace from custom link URL & text

---

## v3.5.2 (2023-05-22)
Expand Down
4 changes: 2 additions & 2 deletions netbox/extras/models/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -274,10 +274,10 @@ def render(self, context):
:param context: The context passed to Jinja2
"""
text = render_jinja2(self.link_text, context)
text = render_jinja2(self.link_text, context).strip()
if not text:
return {}
link = render_jinja2(self.link_url, context)
link = render_jinja2(self.link_url, context).strip()
link_target = ' target="_blank"' if self.new_window else ''

# Sanitize link text
Expand Down

0 comments on commit bf1c191

Please sign in to comment.