Fix nonce attribute string compilation

This commit is contained in:
Alvaro Leonel 2023-05-09 19:11:54 -03:00 committed by Alvaro Mariano
parent b3fdaeb770
commit 0e01713b69

View file

@ -82,7 +82,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(','):