Skip to content

prefetching locations when building dedupe candidate scope queryset#14483

Merged
valentijnscholten merged 4 commits intoDefectDojo:bugfixfrom
dogboat:dedupe-location-prefetch-fix
Mar 13, 2026
Merged

prefetching locations when building dedupe candidate scope queryset#14483
valentijnscholten merged 4 commits intoDefectDojo:bugfixfrom
dogboat:dedupe-location-prefetch-fix

Conversation

@dogboat
Copy link
Copy Markdown
Contributor

@dogboat dogboat commented Mar 10, 2026

This PR updates the build_candidate_scope_queryset() function to handle the prefetch list differently when V3 locations are enabled to prevent crashes when updating locations on a finding. Previously, changing locations when editing a finding would cause a 500 when V3 locations are enabled; now it does not.

Copy link
Copy Markdown
Member

@valentijnscholten valentijnscholten left a comment

Choose a reason for hiding this comment

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

The PR description seems to suggest there is a bug that is fixed by this PR. Should the PR add a testcase to prove the bug is fixed and we don't regress in the future?

@dogboat
Copy link
Copy Markdown
Contributor Author

dogboat commented Mar 10, 2026

The PR description seems to suggest there is a bug that is fixed by this PR. Should the PR add a testcase to prove the bug is fixed and we don't regress in the future?

Good call, added a test for it.

Copy link
Copy Markdown
Contributor

@mtesauro mtesauro left a comment

Choose a reason for hiding this comment

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

Approved

Comment thread unittests/test_deduplication_logic.py Outdated
mtesauro and others added 2 commits March 11, 2026 20:20
@Maffooch Maffooch added this to the 2.56.2 milestone Mar 12, 2026
@valentijnscholten valentijnscholten merged commit 9adc251 into DefectDojo:bugfix Mar 13, 2026
283 of 284 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants