senaite / senaite.core

Enterprise Open Source Laboratory System (LIMS)
https://senaite.com
GNU General Public License v2.0
254 stars 145 forks source link

Fix Traceback on "Manage analyses" when dynamic specs assigned #2486

Closed xispa closed 8 months ago

xispa commented 8 months ago

Description of the issue/feature this PR addresses

This Pull Request fixes a traceback that occurs when accessing to "Manage analyses" from inside sample when dynamic specification assigned

Current behavior before PR

Traceback (innermost last):
  Module ZPublisher.WSGIPublisher, line 176, in transaction_pubevents
  Module ZPublisher.WSGIPublisher, line 385, in publish_module
  Module ZPublisher.WSGIPublisher, line 288, in publish
  Module ZPublisher.mapply, line 85, in mapply
  Module ZPublisher.WSGIPublisher, line 63, in call_object
  Module senaite.app.listing.view, line 246, in __call__
  Module senaite.app.listing.ajax, line 113, in handle_subpath
  Module senaite.core.decorators, line 40, in decorator
  Module senaite.app.listing.decorators, line 63, in wrapper
  Module senaite.app.listing.decorators, line 50, in wrapper
  Module senaite.app.listing.decorators, line 100, in wrapper
  Module senaite.app.listing.ajax, line 383, in ajax_folderitems
  Module senaite.app.listing.decorators, line 88, in wrapper
  Module senaite.app.listing.ajax, line 259, in get_folderitems
  Module bika.lims.browser.analysisrequest.manage_analyses, line 188, in folderitems
  Module senaite.app.listing.view, line 982, in folderitems
  Module bika.lims.browser.analysisrequest.manage_analyses, line 234, in folderitem
  Module plone.memoize.view, line 59, in memogetter
  Module bika.lims.browser.analysisrequest.manage_analyses, line 153, in get_results_range
  Module bika.lims.utils, line 500, in dicts_to_dict
KeyError: 'keyword'

Desired behavior after PR is merged

No traceback

-- I confirm I have tested this PR thoroughly and coded it according to PEP8 and Plone's Python styleguide standards.

ramonski commented 8 months ago

Well combined Dr. Watson 🧐😁 that is indeed true!