Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

[multiple] using safestr in web.form.Dropdown._render_option

  • Loading branch information...
commit 7bca9e5ba522d04afc55d9fbef0697f50b46366b 1 parent 65e5212
@nopri nopri authored
Showing with 7 additions and 1 deletion.
  1. +7 −1 web/form.py
View
8 web/form.py
@@ -253,7 +253,13 @@ def _render_option(self, arg, indent=' '):
else:
value, desc = arg, arg
- if utils.safestr(self.value) == utils.safestr(value) or (isinstance(self.value, list) and value in self.value):
+ value = utils.safestr(value)
+ if isinstance(self.value, (tuple, list)):
+ self.value = [utils.safestr(x) for x in self.value]
+ else:
+ self.value = utils.safestr(self.value)
+
+ if self.value == value or (isinstance(self.value, list) and value in self.value):
select_p = ' selected="selected"'
else:
select_p = ''
Please sign in to comment.
Something went wrong with that request. Please try again.