-
-
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
Publish verified partitions #1428
Conversation
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.
I suggest to add an after_prepublish
function in workflow.analysisrequest.events
|
||
def publish(self, sample): | ||
"""Set status to prepublished/published/republished | ||
""" | ||
# publish partitions | ||
for partition in sample.getDescendants(): | ||
self.publish(partition) |
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.
To keep the code consistent regarding transitions, I think it would be better to add a function def after_prepublish
in workflow.analysisrequest.events
instead of publishing the descendants one by one here. This after_prepublish
transition might look similar to after_publish
funciton:
def after_prepublish(analysis_request):
do_action_to_descendants(analysis_request, "publish")
bika/lims/browser/workflow/client.py
Outdated
@@ -54,6 +54,9 @@ def get_sample_uids_in_report(self, report): | |||
def publish_sample(self, sample): | |||
"""Set status to prepublished/published/republished | |||
""" | |||
# publish partitions | |||
for partition in sample.getDescendants(): | |||
self.publish_sample(partition) |
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.
Same comment as above
…ite.core into partition-publication
Description of the issue/feature this PR addresses
This PR changes the primary sample publication behaviour, so that verified partitions are transitioned to the publish state if they were in verified state before.
Current behavior before PR
If a primary sample with descendants (partitions) is pre-published, none of the verified partitions is published.
Desired behavior after PR is merged
If a primary sample with descendants (partitions) is pre-published, all of the verified partitions are published.
--
I confirm I have tested this PR thoroughly and coded it according to PEP8
and Plone's Python styleguide standards.