[Django] #36793: Reversing RenameModel in an environment with pre-Django 6.0 permission records leaves wrong users & groups associated

3 views
Skip to first unread message

Django

unread,
Dec 11, 2025, 2:11:52 PM12/11/25
to django-...@googlegroups.com
#36793: Reversing RenameModel in an environment with pre-Django 6.0 permission
records leaves wrong users & groups associated
-------------------------------------+-------------------------------------
Reporter: Jacob | Owner: Artyom Kotovskiy
Walls |
Type: Bug | Status: assigned
Component: | Version: 6.0
contrib.auth |
Severity: Release | Keywords:
blocker |
Triage Stage: | Has patch: 1
Unreviewed |
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 1 | Easy pickings: 0
UI/UX: 0 |
-------------------------------------+-------------------------------------
- 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.
--
Ticket URL: <https://code.djangoproject.com/ticket/36793>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Dec 11, 2025, 2:12:21 PM12/11/25
to django-...@googlegroups.com
#36793: Reversing RenameModel in an environment with pre-Django 6.0 permission
records leaves wrong users & groups associated
-------------------------------------+-------------------------------------
Reporter: Jacob Walls | Owner: Artyom
| Kotovskiy
Type: Bug | Status: assigned
Component: contrib.auth | Version: 6.0
Severity: Release blocker | Resolution:
Keywords: | Triage Stage:
| Unreviewed
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 1
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Comment (by Jacob Walls):

[https://github.com/django/django/pull/20339 PR]
--
Ticket URL: <https://code.djangoproject.com/ticket/36793#comment:1>
Reply all
Reply to author
Forward
0 new messages