Skip to content

Commit fc8f6b5

Browse files
committed
Allow 'no value' to be selected in LinkHTMLProperty.menu()
1 parent 18580e6 commit fc8f6b5

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

roundup/cgi/templating.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1873,8 +1873,14 @@ def menu(self, size=None, height=None, showid=0, additional=[], value=None,
18731873
if not self.is_edit_ok():
18741874
return self.plain(escape=1)
18751875

1876+
# Since None indicates the default, we need another way to
1877+
# indicate "no selection". We use -1 for this purpose, as
1878+
# that is the value we use when submitting a form without the
1879+
# value set.
18761880
if value is None:
18771881
value = self._value
1882+
elif value == '-1':
1883+
value = None
18781884

18791885
linkcl = self._db.getclass(self._prop.classname)
18801886
l = ['<select name="%s">'%self._formname]

0 commit comments

Comments
 (0)