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

Remove log verbosity of UIDReference.get when value is None or empty #390

Merged
merged 2 commits into from
Nov 23, 2017

Conversation

xispa
Copy link
Member

@xispa xispa commented Nov 20, 2017

Description of the issue/feature this PR addresses

UIDReferenceField.get tries to fetch the object also if the value stored in the field is empty or None. This causes a lot of verbosity in the logs as if were errors, but are not, e.g.:

2017-11-20 16:43:03 ERROR Bika <Analysis at Zn>.Instrument: Resolving UIDReference failed for .  No object will be returned.
2017-11-20 16:43:03 ERROR Bika <Analysis at Zn>.Method: Resolving UIDReference failed for .  No object will be returned.
2017-11-20 16:43:03 ERROR Bika <Analysis at Zn>.Method: Resolving UIDReference failed for .  No object will be returned.
2017-11-20 16:43:03 ERROR Bika <Analysis at Zn>.Method: Resolving UIDReference failed for .  No object will be returned.
2017-11-20 16:43:03 ERROR Bika <Analysis at Zn>.Instrument: Resolving UIDReference failed for .  No object will be returned.

Current behavior before PR

A lot of false errors appear in the log when calling a UIDReferenceField's get function if the field has no value (or is empty if multivalued) .

Desired behavior after PR is merged

No false-errors in the log.

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

@xispa xispa changed the title Remove verbosity of UIDReference.get when no value is assigned Remove log verbosity of UIDReference.get when value is None or empty Nov 20, 2017
@xispa xispa requested a review from ramonski November 20, 2017 16:02
@xispa xispa merged commit 4614100 into senaite:release-1.1.6 Nov 23, 2017
@xispa xispa deleted the remove-verbosity-uidreference branch November 27, 2017 18:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

Successfully merging this pull request may close these issues.

1 participant