Opened 39 minutes ago

Last modified 33 minutes ago

#36793 assigned Bug

Reverting a model rename in an environment with pre-Django 6.0 permission records leaves wrong users & groups associated

Reported by: Jacob Walls Owned by: Artyom Kotovskiy
Component: contrib.auth Version: 6.0
Severity: Release blocker Keywords:
Cc: Triage Stage: Unreviewed
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: yes
Easy pickings: no UI/UX: no

Description

  • Checkout Django 5.2
  • Assign user 1 to have view permissions on FooModel
  • Rename the model to BarModel
  • Migrate

(Result: no permissions transfer to BarModel, FooModel permissions left behind in the db).

  • Assign user 2 to have view permissions on BarModel
  • Checkout Django 6.0
  • Rename the model back to FooModel and migrate forward

Expected: ?
What user should have view permissions on FooModel now, 1 or 2?

As of #27489, which makes the permissions tag along with RenameModel operations, I think we would expect user 2. (Proposed fix PR makes it Users 1 *and* 2, but I'm interested to hear more on that.)

Actual result: User 1 has the permission on FooModel, and BarModel permissions for User 2 are left behind in the db.

Bug in f02b49d2f3bf84f5225de920ca510149f1f9f1da.

Change History (2)

comment:1 by Jacob Walls, 39 minutes ago

comment:2 by Jacob Walls, 33 minutes ago

Summary: Reversing RenameModel in an environment with pre-Django 6.0 permission records leaves wrong users & groups associatedReverting a model rename in an environment with pre-Django 6.0 permission records leaves wrong users & groups associated
Note: See TracTickets for help on using tickets.
Back to Top