can you use here:
'redirectOnClose': {% if redirect_on_close %}'{{ redirect_on_close }}'{%else %}false{% endif %},
?