Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix occasional error when labeling samples w/o report as printed #1454

Merged
merged 1 commit into from
Oct 13, 2019

Conversation

xispa
Copy link
Member

@xispa xispa commented Oct 12, 2019

Description of the issue/feature this PR addresses

In those extremely rare occasions, if any, that the system cannot retrieve the results pdf from a given sample, the system fails when trying to label multiple samples as "printed". The system was not able to retrieve the results pdf from a sample published 2y ago (several upgrades 1.2.4, 1.2.5 ... 1.3.2 happened since then). This PR does not fix the issue because of its rarity, but ensures that selecting that conflictive sample won't have any effect on the correct labeling of others as "printed".

Current behavior before PR

Traceback (innermost last):

    Module ZPublisher.Publish, line 138, in publish
    Module ZPublisher.mapply, line 77, in mapply
    Module ZPublisher.Publish, line 48, in call_object
    Module bika.lims.browser.workflow, line 143, in _call_
    Module bika.lims.browser.workflow.analysisrequest, line 268, in _call_
    Module bika.lims.browser.workflow.analysisrequest, line 268, in <lambda>
    Module bika.lims.browser.workflow.analysisrequest, line 282, in set_printed_time

IndexError: list index out of range

Desired behavior after PR is merged

No traceback, non-conflictive samples are labeled as "printed".

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

@ramonski ramonski merged commit e830337 into master Oct 13, 2019
@ramonski ramonski deleted the error-label-printed branch October 13, 2019 08:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

2 participants