plone.app.widgets/davisagli-fixes: do not error out if object does not resolve to an uuid
Carlos de la Guardia <jenkins-z4DKO/[email protected]> Tue, 01 Aug 2017 00:37:18 -0700 (PDT)
| Newsgroups | gmane.comp.web.zope.plone.cvs |
|---|---|
| Message-ID | <[email protected]> |
Repository: plone.app.widgets Branch: refs/heads/davisagli-fixes Date: 2017-08-01T02:37:06-05:00 Author: Carlos de la Guardia (cguardia) <cguardia-/[email protected]> Commit: https://github.com/plone/plone.app.widgets/commit/9bb0a0113df6c63be054675cbc2098fd6a070e64 do not error out if object does not resolve to an uuid Files changed: M plone/app/widgets/dx.py diff --git a/plone/app/widgets/dx.py b/plone/app/widgets/dx.py index 4370578..5512d65 100644 --- a/plone/app/widgets/dx.py +++ b/plone/app/widgets/dx.py @@ -333,7 +333,7 @@ def toWidgetValue(self, value): if not value: return self.field.missing_value separator = getattr(self.widget, 'separator', ';') - return separator.join([IUUID(o) for o in value if o]) + return separator.join([IUUID(o) for o in value if o and IUUID(o, False)]) def toFieldValue(self, value): """Converts from widget value to field. ------------------------------------------------------------------------------ Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot