-
Notifications
You must be signed in to change notification settings - Fork 14.4k
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: Improving handling for tag relationship when deleting assets v2 #29229
fix: Improving handling for tag relationship when deleting assets v2 #29229
Conversation
@mistercrunch @john-bodley let me know your thoughts with this approach |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #29229 +/- ##
===========================================
+ Coverage 60.48% 83.73% +23.24%
===========================================
Files 1931 518 -1413
Lines 76236 37522 -38714
Branches 8568 0 -8568
===========================================
- Hits 46114 31419 -14695
+ Misses 28017 6103 -21914
+ Partials 2105 0 -2105
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It'd be great to capture this as comment, something like
viewonly=True, # cascading handled by tag.models.ObjectUpdater.after_delete
for all 3 intances plz. As someone reading the code, it'd be a head scratcher, and I have to say that while I worked on this bug I never knew this ObjectUpdater existed...
SUMMARY
This is a follow up for #29117, since it was confirmed on this comment that the issue still persists.
I'm updating these relationships to
viewonly=True
, since there's already anafter_delete
hook in place to delete tag association after an asset is deleted - reference. With that in mind, handling the cascade deletion in the relationship is redundant.Long-term, we could delete this hook and fix the relationships for a proper cascading deletion -- I'll look into that in a following PR (need to make sure that removing this hook won't impact any other logic in the application).
BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
No UI changes.
TESTING INSTRUCTIONS
ADDITIONAL INFORMATION