Opened 9 years ago

Last modified 10 days ago

#27489 assigned Bug

Renaming a model doesn't rename the permission name and codename

Reported by: Tim Graham Owned by: mrartem1927
Component: contrib.auth Version: dev
Severity: Normal Keywords:
Cc: Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: yes
Easy pickings: no UI/UX: no

Description

After a RenameModel operation, new permissions are created with the name and codename of the new model name rather than renaming the permissions with the old model name. It should be feasible to fix by using an approach similar to f179113e6cbc8ba0a8d4e87e1d4410fb61d63e75 where a RenamePermission operation is injected in the plan after each RenameModel operation.

#26756 requires the same approach except that the RenamePermission operation must be inserted after AlterModelOptions operations with a verbose_name key.

Change History (12)

comment:1 by Morgan Aubert, 9 years ago

Owner: changed from nobody to Morgan Aubert
Status: newassigned

comment:2 by Morgan Aubert, 9 years ago

Added PR

comment:3 by Simon Charette, 9 years ago

Has patch: set
Version: 1.10master

comment:4 by Tim Graham, 9 years ago

Patch needs improvement: set

I left comments for improvement on the patch.

comment:5 by Mariusz Felisiak, 5 years ago

Owner: Morgan Aubert removed
Status: assignednew

comment:6 by Natalia Bidart, 23 months ago

Duplicates of this are #32715 and #34762.

comment:7 by mrartem1927, 2 months ago

Owner: set to mrartem1927
Status: newassigned

comment:9 by Tim Graham, 7 weeks ago

Patch needs improvement: unset

Don't forget to update the ticket's flags so the ticket appears in the review queue.

comment:10 by Sarah Boyce, 6 weeks ago

Needs tests: set

comment:11 by mrartem1927, 4 weeks ago

Needs tests: unset

comment:12 by Sarah Boyce, 10 days ago

Patch needs improvement: set
Note: See TracTickets for help on using tickets.
Back to Top