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
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Changelog

**Fixed**


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

**Security**

Expand Down
4 changes: 4 additions & 0 deletions bika/lims/browser/fields/uidreferencefield.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,8 @@ def get(self, context, **kwargs):
:rtype: BaseContent | list[BaseContent]
"""
value = StringField.get(self, context, **kwargs)
if not value:
return [] if self.multiValued else None
if self.multiValued:
# Only return objects which actually exist; this is necessary here
# because there are no HoldingReferences. This opens the
Expand All @@ -125,6 +127,8 @@ def getRaw(self, context, aslist=False, **kwargs):
:rtype: string | list[string]
"""
value = StringField.get(self, context, **kwargs)
if not value:
return [] if self.multiValued else None
if self.multiValued:
ret = value
else:
Expand Down