Commits

Alex Willmer  committed f978de4

Fix uninitialized end when reading copy_fields from config (backport from define 4)

  • Participants
  • Parent commits 388da01
  • Branches ticket-links-trunk

Comments (0)

Files changed (1)

File trac/ticket/links.py

             # <end>.copy_fields may be absent or intentionally set empty.
             # config.getlist() will return [] in either case, so check that
             # the key is present before assigning the value
-            cf_keys = ['%s.copy_fields' % end for end in [end1, end2] if end]
-            for cf_key in cf_keys:
-                if cf_key in config:
-                    copy_fields[end] = config.getlist(cf_key)
+            for end in [end1, end2]:
+                if end:
+                    cf_key = '%s.copy_fields' % end
+                    if cf_key in config:
+                        copy_fields[end] = config.getlist(cf_key)
             
         return links, labels, validators, blockers, copy_fields