Opened 3 years ago
Closed 12 months ago
#33481 closed Cleanup/optimization (fixed)
Clarify remove_stale_contenttypes data loss warning
Reported by: | Johannes Maron | Owned by: | Syed Waheed |
---|---|---|---|
Component: | contrib.contenttypes | Version: | dev |
Severity: | Normal | Keywords: | |
Cc: | Triage Stage: | Ready for checkin | |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
I just wanted to remove stale contenttypes from a system and noticed a pretty significant bug.
The command prints a message before you need to confirm the deletion that reads:
This list doesn't include any cascade deletions to data outside of Django's models (uncommon).
However, a quick investigation on the objects that are to be deleted includes objects outside of Django's scope.
In my case:
- 2 auth.Group_permissions object(s)
- 7185 joeflow.Task object(s)
- 5519 joeflow.Task_parent_task_set object(s)
This misinformation can cause users to delete data without double-checking.
Change History (11)
comment:1 by , 3 years ago
comment:2 by , 3 years ago
Component: | Uncategorized → Documentation |
---|---|
Severity: | Release blocker → Normal |
Type: | Bug → Cleanup/optimization |
Oooooh, now I get it. Wow, OK, is it just me, or is that sentence misleading? Maybe we replace that sentence something that doesn't include brackets at the end and not the term "Django's models"? Something a long the lines of:
The list above does not include deletions that may be caused by manually added database constraints or triggers.
comment:3 by , 3 years ago
Component: | Documentation → contrib.contenttypes |
---|---|
Summary: | remove_stale_contenttypes causes data loss → Clarify remove_stale_contenttypes data loss warning |
Triage Stage: | Unreviewed → Accepted |
I wrote the original sentence in e2dfa81ff7489d97700604d634adacf1384af184. I guess you may have interpreted "Django's models" to mean contrib.auth
? I don't have an objection to some rewording but for me, it's more intuitive to talk about "cascade deletions" and "relations" rather than "constraints or triggers." Feel free to submit a PR to continue the discussion with a merger.
comment:4 by , 12 months ago
Owner: | changed from | to
---|---|
Status: | new → assigned |
follow-up: 7 comment:6 by , 12 months ago
link to my fork - https://github.com/Waheedsys/django
link to my commit - https://github.com/django/django/compare/main...Waheedsys:django:main
I would like to have a review of the changes
comment:7 by , 12 months ago
Replying to Syed Waheed:
link to my fork - https://github.com/Waheedsys/django
link to my commit - https://github.com/django/django/compare/main...Waheedsys:django:main
I would like to have a review of the changes
Please send a patch via GitHub PR (check out docs for more details).
comment:9 by , 12 months ago
Has patch: | set |
---|---|
Patch needs improvement: | set |
comment:10 by , 12 months ago
Patch needs improvement: | unset |
---|---|
Triage Stage: | Accepted → Ready for checkin |
I think you've misunderstood the message. The data you listed seem to be Django objects and relations. Why do you say they are "outside of Django's scope"? Aren't they printed as part of the deletion warning?