Fix: Add a new custom delete for parent field in taxontreedefitem - #8375
Conversation
|
Warning Review limit reachedNext included review available in 58 minutes. View limit detailsLimit details: You’ve used the included review currently available. You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Review configuration: ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (3)
📝 WalkthroughWalkthroughChangesThe PR adds context-aware deletion handling for Context-aware taxon deletion
Geolocation formatting
Sequence Diagram(s)sequenceDiagram
participant DjangoCollector
participant DeleteHandler
participant TaxonTreeDefItem
DjangoCollector->>DeleteHandler: provide deletion context
DeleteHandler->>TaxonTreeDefItem: inspect tree deletion state
DeleteHandler-->>DjangoCollector: return CASCADE or DO_NOTHING
🚥 Pre-merge checks | ✅ 3 | ❌ 3❌ Failed checks (2 warnings, 1 inconclusive)
✅ Passed checks (3 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
Warning One or more dependencies are approaching or past End-of-Life. |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@specifyweb/frontend/js_src/lib/components/WbToolkit/GeoLocate.tsx`:
- Around line 281-284: Update the points construction to distinguish coordinate
parse failures from valid zero values: use a parse-aware helper near the
existing formatCoordinate logic that returns undefined for unparseable latitude
or longitude, then set points only when both parsed coordinates are defined.
Preserve formatting for valid coordinates, including zero, and leave points
undefined for blank or malformed values.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: f492c1ce-856d-4c92-b81b-0d4c2f2b2937
📒 Files selected for processing (3)
specifyweb/frontend/js_src/lib/components/WbToolkit/GeoLocate.tsxspecifyweb/specify/migrations/0047_taxontreedefitem_parent_context_delete.pyspecifyweb/specify/models.py
|
@CodeRabbit full review |
✅ Action performedFull review finished. Your included review limit is currently reached under our Fair Usage Limits Policy. This review may still proceed through usage-based billing if eligible. Your next included review will be available in 24 minutes. |
|
@CodeRabbit full review |
✅ Action performedFull review finished. |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@specifyweb/specify/models.py`:
- Around line 20-32: Update delete_taxon_rank_parent_with_context for
individual-rank deletion to validate that the rank is unused and reparent any
child treedefitems before deletion, preventing dangling
DefinitionID/DefinitionItemID references; do not return models.DO_NOTHING for
this path. Preserve the existing models.CASCADE behavior when is_tree_delete
detects a full TaxonTreeDef deletion.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: b5a6521c-878d-4de4-9e93-9ef2dd5e56ca
📒 Files selected for processing (3)
specifyweb/frontend/js_src/lib/components/WbToolkit/GeoLocate.tsxspecifyweb/specify/migrations/0047_taxontreedefitem_parent_context_delete.pyspecifyweb/specify/models.py
…ed with implicit (fall through) returns' Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
eef3956 to
fb39fa6
Compare
emenslin
left a comment
There was a problem hiding this comment.
- Verify you can delete unused ranks
- Verify you cannot delete used ranks
- Verify you can delete non default trees
Looks good, I didn't run into any new issues.
kwhuber
left a comment
There was a problem hiding this comment.
- Verify you can delete unused ranks
- Verify you cannot delete used ranks
- Verify you can delete non default trees
Fixes #8310
Warning
This PR affects database migrations. See migration testing instructions.
Checklist
self-explanatory (or properly documented)
specify7/specifyweb/specify/management/commands/run_key_migration_functions.py
Line 50 in ea04665
Testing instructions
Summary by CodeRabbit