--- a/src/pyams_sequence/widget/__init__.py Thu Feb 08 15:03:18 2018 +0100
+++ b/src/pyams_sequence/widget/__init__.py Fri Feb 09 16:34:57 2018 +0100
@@ -121,16 +121,17 @@
def values_map(self):
catalog = get_utility(ICatalog)
sequence = get_utility(ISequentialIntIds)
+ results = {}
values = self.value
- if isinstance(values, str):
- values = values.split(',')
- params = Any(catalog['oid'], values)
- results = {}
- for item in map(get_last_version, CatalogResultSet(CatalogQuery(catalog).query(params))):
- oid_info = ISequentialIdInfo(item)
- results.update({oid_info.hex_oid: '{0} ({1})'.format(II18n(item).query_attribute('title',
- request=self.request),
- sequence.get_short_oid(oid_info.oid))})
+ if values:
+ if isinstance(values, str):
+ values = values.split(',')
+ params = Any(catalog['oid'], values)
+ for item in map(get_last_version, CatalogResultSet(CatalogQuery(catalog).query(params))):
+ oid_info = ISequentialIdInfo(item)
+ results.update({oid_info.hex_oid: '{0} ({1})'.format(II18n(item).query_attribute('title',
+ request=self.request),
+ sequence.get_short_oid(oid_info.oid))})
return json.dumps(results)