This is an automated email from the ASF dual-hosted git repository.

brondsem pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/allura.git


The following commit(s) were added to refs/heads/master by this push:
     new 5d36b5667 Fix bad js syntax. cleaner & safer too
5d36b5667 is described below

commit 5d36b56677f9d50727bf4a0ae7c9a6f16d0d89f7
Author: Dave Brondsema <dbronds...@slashdotmedia.com>
AuthorDate: Wed Aug 24 10:33:17 2022 -0400

    Fix bad js syntax. cleaner & safer too
---
 Allura/allura/lib/widgets/forms.py | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)

diff --git a/Allura/allura/lib/widgets/forms.py 
b/Allura/allura/lib/widgets/forms.py
index bd5cbd7fa..bd1ab5e0e 100644
--- a/Allura/allura/lib/widgets/forms.py
+++ b/Allura/allura/lib/widgets/forms.py
@@ -333,12 +333,7 @@ class PersonalDataForm(ForgeForm):
 
         yield ew.JSScript('''
 var $allTimezones = $("#tz").clone();
-var $t = {};
-''' +
-                          reduce(_append, [
-                              '$t["' + el + '"] = ' + str([name.encode('utf-8')
-                                                           for name in 
country_timezones[el]]) + ";\n"
-                              for el in country_timezones]) + '''
+var $t = ''' + h.escape_json(dict(country_timezones)) + ''';
 function selectTimezone($country){
      if($country == " "){
          $("#tz").replaceWith($allTimezones);

Reply via email to