Opened 12 months ago

Last modified 11 months ago

#27489 assigned Bug

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

Reported by: Tim Graham Owned by: Morgan Aubert
Component: contrib.auth Version: master
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 (4)

comment:1 Changed 11 months ago by Morgan Aubert

Owner: changed from nobody to Morgan Aubert
Status: newassigned

comment:2 Changed 11 months ago by Morgan Aubert

Added PR

comment:3 Changed 11 months ago by Simon Charette

Has patch: set
Version: 1.10master

comment:4 Changed 11 months ago by Tim Graham

Patch needs improvement: set

I left comments for improvement on the patch.

Note: See TracTickets for help on using tickets.
Back to Top