Changeset - 41f780117963
[Not reviewed]
default
0 1 0
Mads Kiilerich - 6 years ago 2019-08-18 15:52:33
mads@kiilerich.com
Grafted from: 26bf5e23891b
helpers: fix bad handling of select values with length 2 - 'hg' showed up as 'g' in repo types list

Strings with length 2 are not tuples ...
1 file changed with 2 insertions and 3 deletions:
0 comments (0 inline, 0 general)
kallithea/lib/helpers.py
Show inline comments
 
@@ -164,10 +164,9 @@ def select(name, selected_values, option
 
    if isinstance(options, list):
 
        l = []
 
        for x in options:
 
            try:
 
            if isinstance(x, tuple) and len(x) == 2:
 
                value, label = x
 
            except ValueError: # too many values to unpack
 
                if isinstance(x, basestring):
 
            elif isinstance(x, basestring):
 
                    value = label = x
 
                else:
 
                    log.error('invalid select option %r', x)
0 comments (0 inline, 0 general)