Opened 7 years ago
Closed 7 years ago
#28417 closed Bug (wontfix)
django.db.migrations.DeleteModel doesn't delete corresponding permissions
Reported by: | nikokio | Owned by: | nobody |
---|---|---|---|
Component: | contrib.auth | Version: | 1.11 |
Severity: | Normal | Keywords: | |
Cc: | Triage Stage: | Unreviewed | |
Has patch: | no | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
Hello,
When deleting a model with django.db.migrations.DeleteModel, I notice permissions for this model still exist in table AUTH_PERMISSION and are still available in the Django GUI.
They should be logically deleted with the model.
Regards
Nicolas
Change History (1)
comment:1 by , 7 years ago
Component: | Migrations → contrib.auth |
---|---|
Resolution: | → wontfix |
Status: | new → closed |
Summary: | django.db.migrations.DeleteModel doesn't cascade permissions → django.db.migrations.DeleteModel doesn't delete corresponding permissions |
Note:
See TracTickets
for help on using tickets.
In
contrib.contenttypes
, staleContentType
s must be deleted with theremove_stale_contenttypes
management command. They aren't removed automatically to prevent unexpected cascading data loss. SincePermission
has a foreign key toContentType
, stale permissions are deleted when removing stale content types. I think it's safer to keep the current workflow rather than automatically removing data. You can write to the DevelopersMailingList if you disagree with this reasoning.