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 assessment list to make distinct by assessment #930

Merged
merged 4 commits into from
Oct 20, 2023

Conversation

shapiromatron
Copy link
Owner

@shapiromatron shapiromatron commented Oct 18, 2023

Fix bug where /assessment/all/ duplicated assessments based on the number of people assigned to various roles. The previous implementation made duplicative assessments since it was generating a row for each assessment-user combination; to dedup using the distinct() disabled our ability to have a custom sort ordering.

The new approach breaks adds an Exists annotation to the assessment so we prevent the duplicates; query performance is actually faster despite the extra annotations.

Copy link
Contributor

@dannypeterson dannypeterson left a comment

Choose a reason for hiding this comment

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

neat use of djangos built in classes and interesting fix! approved

@shapiromatron shapiromatron marked this pull request as ready for review October 19, 2023 15:59
@shapiromatron shapiromatron merged commit f4d12fb into main Oct 20, 2023
@shapiromatron shapiromatron deleted the distinct-assessment-list branch October 20, 2023 20:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants