[Zope3-checkins] CVS: Zope3/src/zope/app/browser/form - vocabularywidget.py:1.44
Fred L. Drake, Jr.
fred@zope.com
Tue, 17 Jun 2003 16:12:03 -0400
Update of /cvs-repository/Zope3/src/zope/app/browser/form
In directory cvs.zope.org:/tmp/cvs-serv28046
Modified Files:
vocabularywidget.py
Log Message:
Change the way we deal with the "no value" token to be more reliable
in the face of weird browsers.
=== Zope3/src/zope/app/browser/form/vocabularywidget.py 1.43 => 1.44 ===
--- Zope3/src/zope/app/browser/form/vocabularywidget.py:1.43 Tue Jun 17 12:02:13 2003
+++ Zope3/src/zope/app/browser/form/vocabularywidget.py Tue Jun 17 16:12:02 2003
@@ -261,10 +261,11 @@
_msg_no_value = message(_("vocabulary-no-value"), "(no value)")
def _compute_data(self):
- if self.name in self.request.form:
- token = self.request.form[self.name]
+ token = self.request.form.get(self.name)
+ if token:
return self.convertTokensToValues([token])[0]
- return None
+ else:
+ return None
class MultiDataHelper(object):