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

Fix Samples not sorted in natural order when Worksheet Template is used #1673

Merged
merged 1 commit into from Nov 5, 2020

Conversation

xispa
Copy link
Member

@xispa xispa commented Nov 4, 2020

Description of the issue/feature this PR addresses

When a Worksheet Template is used for the creation of a Worksheet, the system searches first for analyses based on their priority sort key ascending, which value is directly related with the Priority field from the Sample. This guarantees that analyses from samples with more priority are considered first while creating worksheets. However, once analyses are added in the worksheet, same sorting is kept.

This Pull Request makes samples from analyses to always be added in natural order when a template is used, while preserving the priority criteria when fetching the analyses from the database.

Current behavior before PR

Samples are not added in natural order in worksheets when a Worksheet Template is used

Desired behavior after PR is merged

Samples are added in natural order in worksheets when a Worksheet Template is used, regardless of their priority

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

@xispa xispa requested a review from ramonski November 4, 2020 09:12
@xispa xispa added the Bug 🐞 label Nov 4, 2020
@ramonski ramonski merged commit 6f97c8b into 1.3.x Nov 5, 2020
@ramonski ramonski deleted the worksheet-template-samples-sorting branch November 5, 2020 20:01
@xispa xispa added the To port label Nov 6, 2020
@xispa xispa removed the To port label Jul 3, 2022
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.

None yet

2 participants