Skip to content

Commit

Permalink
Fix nonce attribute string compilation
Browse files Browse the repository at this point in the history
  • Loading branch information
AlvaroLQueiroz committed May 10, 2023
1 parent a28c4b5 commit 2a7353e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion notifications/templatetags/notifications_tags.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ def register_notify_callbacks(badge_class='live_notify_badge', # pylint: disabl
)

# add a nonce value to the script tag if one is provided
nonce_str = ' nonce="{nonce}"'.format(nonce=nonce) if nonce is not None else ""
nonce_str = ' nonce="{nonce}"'.format(nonce=nonce) if nonce else ""

script = '<script type="text/javascript"{nonce}>'.format(nonce=nonce_str) + definitions
for callback in callbacks.split(','):
Expand Down

0 comments on commit 2a7353e

Please sign in to comment.