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

Publish verified partitions #1428

Merged
merged 10 commits into from
Sep 12, 2019
Merged

Publish verified partitions #1428

merged 10 commits into from
Sep 12, 2019

Conversation

ramonski
Copy link
Contributor

@ramonski ramonski commented Aug 20, 2019

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.

Copy link
Member

@xispa xispa left a 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)
Copy link
Member

@xispa xispa Sep 3, 2019

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")

@@ -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)
Copy link
Member

Choose a reason for hiding this comment

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

Same comment as above

@xispa xispa merged commit 1ba9f7f into master Sep 12, 2019
@xispa xispa deleted the partition-publication branch September 12, 2019 19:01
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