You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Accessing the Sample on it's own, e.g. over the API v2 (/@@API/v2/sample/<UID>) fails if now SampleType is set and the accessor getSampleTypeUID is called.
Current behavior
The following Traceback occurs:
Traceback (most recent call last):
File "/Users/rbartl/develop/ridingbytes/bika/buildout/eggs/plone.jsonapi.core-0.6-py2.7.egg/plone/jsonapi/core/browser/decorators.py", line 24, in decorator
return f(*args, **kwargs)
File "/Users/rbartl/develop/ridingbytes/bika/buildout/eggs/plone.jsonapi.core-0.6-py2.7.egg/plone/jsonapi/core/browser/api.py", line 60, in to_json
return self.dispatch()
File "/Users/rbartl/develop/ridingbytes/bika/buildout/eggs/plone.jsonapi.core-0.6-py2.7.egg/plone/jsonapi/core/browser/api.py", line 54, in dispatch
return router(self.context, self.request, path)
File "/Users/rbartl/develop/ridingbytes/bika/buildout/eggs/plone.jsonapi.core-0.6-py2.7.egg/plone/jsonapi/core/browser/router.py", line 138, in __call__
return self.view_functions[endpoint](context, request, **values)
File "/Users/rbartl/develop/ridingbytes/bika/buildout/src/bika.lims/bika/lims/jsonapi/v2/routes/content.py", line 97, in search
return api.get_batched()
File "/Users/rbartl/develop/ridingbytes/bika/buildout/src/bika.lims/bika/lims/jsonapi/api.py", line 79, in get_batched
complete=complete)
File "/Users/rbartl/develop/ridingbytes/bika/buildout/src/bika.lims/bika/lims/jsonapi/api.py", line 1393, in get_batch
endpoint, complete=complete),
File "/Users/rbartl/develop/ridingbytes/bika/buildout/src/bika.lims/bika/lims/jsonapi/api.py", line 234, in make_items_for
return map(extract_data, brains_or_objects)
File "/Users/rbartl/develop/ridingbytes/bika/buildout/src/bika.lims/bika/lims/jsonapi/api.py", line 229, in extract_data
info = get_info(brain_or_object, endpoint=endpoint, complete=complete)
File "/Users/rbartl/develop/ridingbytes/bika/buildout/src/bika.lims/bika/lims/jsonapi/api.py", line 273, in get_info
info.update(adapter.to_dict())
File "/Users/rbartl/develop/ridingbytes/bika/buildout/src/bika.lims/bika/lims/jsonapi/dataproviders.py", line 52, in to_dict
data = self.extract_fields()
File "/Users/rbartl/develop/ridingbytes/bika/buildout/src/bika.lims/bika/lims/jsonapi/dataproviders.py", line 89, in extract_fields
fieldvalue = dm.json_data(fieldname)
File "/Users/rbartl/develop/ridingbytes/bika/buildout/src/bika.lims/bika/lims/jsonapi/datamanagers.py", line 171, in json_data
return fieldmanager.json_data(self.context)
File "/Users/rbartl/develop/ridingbytes/bika/buildout/src/bika.lims/bika/lims/jsonapi/fieldmanagers.py", line 258, in json_data
value = self.get(instance)
File "/Users/rbartl/develop/ridingbytes/bika/buildout/src/bika.lims/bika/lims/jsonapi/fieldmanagers.py", line 204, in get
return self._get(instance, **kw)
File "/Users/rbartl/develop/ridingbytes/bika/buildout/src/bika.lims/bika/lims/jsonapi/fieldmanagers.py", line 253, in _get
return self.field.get(instance)
File "/Users/rbartl/develop/ridingbytes/bika/buildout/eggs/Products.Archetypes-1.9.13-py2.7.egg/Products/Archetypes/Field.py", line 2156, in get
return eval(self.expression, {'context': instance, 'here': instance})
File "<string>", line 1, in <module>
AttributeError: 'NoneType' object has no attribute 'UID'
Expected behavior
The computed field reurns None
The text was updated successfully, but these errors were encountered:
Steps to reproduce
Accessing the Sample on it's own, e.g. over the API v2 (
/@@API/v2/sample/<UID>
) fails if now SampleType is set and the accessorgetSampleTypeUID
is called.Current behavior
The following Traceback occurs:
Expected behavior
The computed field reurns
None
The text was updated successfully, but these errors were encountered: