Fix URL params defaults for int choices
URL parameters are passed in as strings so they would not register as selected for choices with int values. As a result a render=0 link would nt pass these parameters correctly. Thanks to Richard Kampmann for noting and reporting this rather obscure bug!
This commit is contained in:
parent
e28976d5e3
commit
6cb2af9cc9
|
@ -169,7 +169,7 @@ class BServer:
|
|||
elif a.choices:
|
||||
options = "\n".join(
|
||||
("""<option value="%s"%s>%s</option>""" %
|
||||
(e, ' selected="selected"' if e == (default or a.default) else "",
|
||||
(e, ' selected="selected"' if (e == (default or a.default)) or (str(e) == str(default or a.default)) else "",
|
||||
_(e)) for e in a.choices))
|
||||
input = """<select name="%s" size="1">\n%s</select>\n""" % (name, options)
|
||||
else:
|
||||
|
|
Loading…
Reference in New Issue