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

implementing manual logic of on_delete option in M2M models #1344

Closed

Conversation

yaswanthsaivendra
Copy link
Contributor

@yaswanthsaivendra yaswanthsaivendra commented Jun 2, 2023

Proposed Changes

Associated Issue

@coronasafe/code-reviewers

@yaswanthsaivendra yaswanthsaivendra requested a review from a team as a code owner June 2, 2023 22:59
@yaswanthsaivendra
Copy link
Contributor Author

@rithviknishad Review please!

Copy link
Member

@rithviknishad rithviknishad left a comment

Choose a reason for hiding this comment

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

You are performing <QuerySet>.delete(). However, we've overridden the <Instance>.delete() to soft delete only.
Would <QuerySet>.delete() call the overridden delete method and soft delete or does it hard delete?

@rithviknishad
Copy link
Member

@yaswanthsaivendra also could you prefix the issue numbers with "Fixes" or other linking keywords?

@sonarcloud
Copy link

sonarcloud bot commented Jun 3, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 1 Code Smell

No Coverage information No Coverage information
0.0% 0.0% Duplication

@yaswanthsaivendra
Copy link
Contributor Author

You are performing <QuerySet>.delete(). However, we've overridden the <Instance>.delete() to soft delete only. Would <QuerySet>.delete() call the overridden delete method and soft delete or does it hard delete?

🤦😅 hard delete, made changes to soft delete

@yaswanthsaivendra
Copy link
Contributor Author

yaswanthsaivendra commented Jun 3, 2023

@yaswanthsaivendra also could you prefix the issue numbers with "Fixes" or other linking keywords?

My bad, I did all changes in single commit 😮‍💨. Referenced the changes in each task. Please check it now!
ohh okay, Got it. Made that change in all my open PRs

@yaswanthsaivendra
Copy link
Contributor Author

@sainak Please review this

@vigneshhari
Copy link
Member

@sainak Can you review?

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.

Manually cascade delete M2M models when related model is deleted.
4 participants