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

Traceback in Instruments list after adding a calibration certificate #451

Closed
wants to merge 2 commits into from

Conversation

xispa
Copy link
Member

@xispa xispa commented Dec 6, 2017

Description of the issue/feature this PR addresses

Traceback is rised in Instruments list after adding a calibration certificate to one of them
Linked issue: #442

Current behavior before PR

The following traceback is rised in instruments list after adding a calibration certificate to one of them:

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.bika_listing, line 936, in call
Module Products.Five.browser.pagetemplatefile, line 125, in call
Module Products.Five.browser.pagetemplatefile, line 59, in call
Module zope.pagetemplate.pagetemplate, line 132, in pt_render
Module five.pt.engine, line 98, in call
Module z3c.pt.pagetemplate, line 163, in render
Module chameleon.zpt.template, line 276, in render
Module chameleon.template, line 191, in render
Module chameleon.template, line 171, in render
Module a4d4e8c1e59c4a4e78270b349f009dc7.py, line 519, in render
Module bab1671251b6685272775265b52480e7.py, line 1420, in render_master
Module bab1671251b6685272775265b52480e7.py, line 578, in render_content
Module a4d4e8c1e59c4a4e78270b349f009dc7.py, line 417, in __fill_content_core
Module five.pt.expressions, line 161, in call
Module bika.lims.browser.bika_listing, line 1376, in contents_table
Module bika.lims.browser.bika_listing, line 1536, in init
Module bika.lims.controlpanel.bika_instruments, line 121, in folderitems
TypeError: 'datetime.timedelta' object is not iterable

Desired behavior after PR is merged

The list of instruments is displayed without any error

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

Copy link
Contributor

@ramonski ramonski left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I did most of this logic already in https://github.com/bikalims/bika.lims/blob/master/bika/lims/content/instrument.py and would like to merge that instead

days = -days if expired else days
weeks = -weeks if expired else weeks
return weeks, days

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@xispa
Copy link
Member Author

xispa commented Dec 9, 2017

Superseded by #459

@xispa xispa closed this Dec 9, 2017
@xispa xispa deleted the i442 branch December 9, 2017 21:38
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