-
-
Notifications
You must be signed in to change notification settings - Fork 152
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
ReferenceWidget does not handle searches with null/None #1014
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ast does not convert "null" to python's None and the following Traceback is thrown: 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.widgets.referencewidget, line 204, in __call__ Module bika.lims.browser.client.ajax, line 31, in __call__ Module bika.lims.adapters.referencewidgetvocabulary, line 44, in __call__ Module ast, line 80, in literal_eval Module ast, line 63, in _convert Module ast, line 62, in <genexpr> Module ast, line 60, in _convert Module ast, line 79, in _convert ValueError: malformed string ast.literal_eval has been replaced by built-in json.loads, and to overcome the issue about unicodes: #443 a function that converts unicodes to strings recursively has been added, as suggested in the same issue above
xispa
added a commit
to senaite/senaite.health
that referenced
this pull request
Aug 30, 2018
Dependencies: senaite/senaite.core#1014 In AR Add form, do not display doctors from other client than the one selected, but include those that do not have any client assigned
xispa
added a commit
to senaite/senaite.health
that referenced
this pull request
Aug 30, 2018
Dependencies: senaite/senaite.core#1014 In AR Add form, do not display doctors from other client than the one selected, but include those that do not have any client assigned
Ok, just tested it here once again:
So |
ramonski
approved these changes
Aug 31, 2018
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
xispa
added a commit
to senaite/senaite.health
that referenced
this pull request
Aug 31, 2018
) * Filter doctors by current's user client If the current user is a Client contact, only the doctors assigned to the same client and those that do not have any client assigned are displayed. If user is from the lab, no filtering is applied. If the current context of the listing is Client, only doctors assigned to same client are displayed. * Cleanup folderitems function from Doctors view * Cleanup Doctors listing view Dependencies: senaite/senaite.core#1012 * Hide doctors from other clients when logged as client * Don't display doctors from other clients in AR Add Dependencies: senaite/senaite.core#1014 In AR Add form, do not display doctors from other client than the one selected, but include those that do not have any client assigned * Don't display doctors from other clients in AR Add Dependencies: senaite/senaite.core#1014 In AR Add form, do not display doctors from other client than the one selected, but include those that do not have any client assigned * Do not display doctors from other clients in Case Add view * Add Primary Referrer column in Doctor listings
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description of the issue/feature this PR addresses
ast.literal_eval
does not convert javascript'snull
to python'sNone
and the following Traceback is thrown:ast.literal_eval
has been replaced by built-injson.loads
, and to overcome the issue about unicodes, a function that converts unicodes to strings recursively has been added, as suggested in the same issue above.Sometimes, searching catalog for a content type with a field that has either a value or
None
is highly desirable. E.g (in health):This search will include all Doctors that belong to the client
client_uid
and those that are not assigned to any client.Current behavior before PR
ReferenceWidget does not supports searches with "null" values.
Desired behavior after PR is merged
ReferenceWidget does not supports searches with "null" values.
--
I confirm I have tested this PR thoroughly and coded it according to PEP8
and Plone's Python styleguide standards.