Re: [Django] #36793: Reverting a model rename in an environment with pre-Django 6.0 permission records leaves wrong users & groups associated

6 views
Skip to first unread message

Django

unread,
Dec 11, 2025, 6:36:16 PM12/11/25
to django-...@googlegroups.com
#36793: Reverting a model rename 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 Antoliny):

I think only user 2 should have the permission, and raising an error would
be appropriate.
From the perspective of the person performing this operation, they would
naturally expect user 2 to have the permission (considering the intent of
#27489).
It feels strange that ghost data created by a bug would come back into
play.
When an error occurs, it would help the developer become aware of the
issue.
I'm also curious to hear others' opinions :)
--
Ticket URL: <https://code.djangoproject.com/ticket/36793#comment:3>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Dec 11, 2025, 7:53:24 PM12/11/25
to django-...@googlegroups.com
#36793: Reverting a model rename 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
-------------------------------------+-------------------------------------
Changes (by Antoliny):

* cc: Antoliny (added)

--
Ticket URL: <https://code.djangoproject.com/ticket/36793#comment:4>

Django

unread,
Dec 12, 2025, 10:32:57 AM12/12/25
to django-...@googlegroups.com
#36793: Reverting a model rename 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 Clifford Gama):

I share your position, Jacob and Antoliny.

That user 2 does not have the permissions is definitely a bug in 6.0, so
that needs to be fixed and backported.

Whether user 1 also ends up having the permissions should depend on
whether that was the behavior before the patch in #27489 landed. If it
wasn't then it would need a new-feature-like release note, meaning it
cannot be backported. If it was, then it should be fixed as a regression
in a new feature.
--
Ticket URL: <https://code.djangoproject.com/ticket/36793#comment:5>

Django

unread,
Dec 12, 2025, 10:40:31 AM12/12/25
to django-...@googlegroups.com
#36793: Reverting a model rename 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: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 1
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Clifford Gama):

* stage: Unreviewed => Accepted

--
Ticket URL: <https://code.djangoproject.com/ticket/36793#comment:6>

Django

unread,
Dec 12, 2025, 11:08:08 AM12/12/25
to django-...@googlegroups.com
#36793: Reverting a model rename 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: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 1
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Comment (by Jacob Walls):

Thanks for the gut checks. So my understanding is that #27489 fixed the
bug where permissions for a model being renamed were left stranded. So
when un-renaming in Django 6, if we choose to overwrite any records
stranded before Django 6, that's a bugfix and something subject to the
backward compat guarantee, since they shouldn't have been there at all. 🤔
--
Ticket URL: <https://code.djangoproject.com/ticket/36793#comment:7>

Django

unread,
Dec 12, 2025, 11:36:27 AM12/12/25
to django-...@googlegroups.com
#36793: Reverting a model rename 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: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 1
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Comment (by Clifford Gama):

All right, that makes sense. In that case maybe we want user 1 to also
have the permission, since it possibly was never explicitly deleted and it
should have been carried over in the model renaming. But I don't have a
strong opinion about it.
--
Ticket URL: <https://code.djangoproject.com/ticket/36793#comment:8>

Django

unread,
Dec 12, 2025, 11:37:20 AM12/12/25
to django-...@googlegroups.com
#36793: Reverting a model rename 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: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 1
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Clifford Gama):

* cc: Clifford Gama (added)

--
Ticket URL: <https://code.djangoproject.com/ticket/36793#comment:9>

Django

unread,
Dec 12, 2025, 12:08:23 PM12/12/25
to django-...@googlegroups.com
#36793: Reverting a model rename 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: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 1
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Comment (by Jacob Walls):

I think my hesitation there is that if you've done a model rename in
Django 5, you've started over on your permissions, and you could have made
N edits. If on Django 6 you then do a model un-rename, you'd probably be
pretty surprised to see some random edits from N edits ago merged in.
--
Ticket URL: <https://code.djangoproject.com/ticket/36793#comment:10>

Django

unread,
Dec 12, 2025, 12:20:51 PM12/12/25
to django-...@googlegroups.com
#36793: Reverting a model rename 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: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 1
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Comment (by Clifford Gama):

Let's make it user 2 only, then. Its the safer option. We don't want to
surprise folks by giving users outdated permissions.
--
Ticket URL: <https://code.djangoproject.com/ticket/36793#comment:11>

Django

unread,
Dec 16, 2025, 10:11:50 AM12/16/25
to django-...@googlegroups.com
#36793: Reverting a model rename 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: Accepted
Has patch: 1 | Needs documentation: 1
Needs tests: 1 | Patch needs improvement: 1
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Jacob Walls):

* needs_docs: 0 => 1
* needs_tests: 0 => 1

--
Ticket URL: <https://code.djangoproject.com/ticket/36793#comment:12>

Django

unread,
Dec 31, 2025, 3:08:37 PM12/31/25
to django-...@googlegroups.com
#36793: Reverting a model rename 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: Accepted
Has patch: 1 | Needs documentation: 1
Needs tests: 1 | Patch needs improvement: 1
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Comment (by Jacob Walls):

Alternative PR with PR comments annotating salient behavior changes:
https://github.com/django/django/pull/20481

Also, some remarks about prior precedents in this area:
https://github.com/django/django/pull/20339#issuecomment-3702832303
--
Ticket URL: <https://code.djangoproject.com/ticket/36793#comment:13>

Django

unread,
Jan 5, 2026, 2:19:44 PMJan 5
to django-...@googlegroups.com
#36793: Reverting a model rename in an environment with pre-Django 6.0 permission
records leaves wrong users & groups associated
---------------------------------+---------------------------------------
Reporter: Jacob Walls | Owner: Jacob Walls
Type: Bug | Status: assigned
Component: contrib.auth | Version: 6.0
Severity: Release blocker | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
---------------------------------+---------------------------------------
Changes (by Jacob Walls):

* needs_better_patch: 1 => 0
* needs_docs: 1 => 0
* needs_tests: 1 => 0
* owner: Artyom Kotovskiy => Jacob Walls

Comment:

[https://github.com/django/django/pull/20497 PR] to revert #27489
--
Ticket URL: <https://code.djangoproject.com/ticket/36793#comment:14>

Django

unread,
Jan 5, 2026, 2:45:38 PMJan 5
to django-...@googlegroups.com
#36793: Reverting a model rename in an environment with pre-Django 6.0 permission
records leaves wrong users & groups associated
-------------------------------------+-------------------------------------
Reporter: Jacob Walls | Owner: Jacob
| Walls
Type: Bug | Status: assigned
Component: contrib.auth | Version: 6.0
Severity: Release blocker | Resolution:
Keywords: | Triage Stage: Ready for
| checkin
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Natalia Bidart):

* stage: Accepted => Ready for checkin

--
Ticket URL: <https://code.djangoproject.com/ticket/36793#comment:15>

Django

unread,
Jan 5, 2026, 3:45:36 PMJan 5
to django-...@googlegroups.com
#36793: Reverting a model rename in an environment with pre-Django 6.0 permission
records leaves wrong users & groups associated
-------------------------------------+-------------------------------------
Reporter: Jacob Walls | Owner: Jacob
| Walls
Type: Bug | Status: closed
Component: contrib.auth | Version: 6.0
Severity: Release blocker | Resolution: fixed
Keywords: | Triage Stage: Ready for
| checkin
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Jacob Walls <jacobtylerwalls@…>):

* resolution: => fixed
* status: assigned => closed

Comment:

In [changeset:"030c63d329c4814da221528e823a4aaaaa40e4f1" 030c63d3]:
{{{#!CommitTicketReference repository=""
revision="030c63d329c4814da221528e823a4aaaaa40e4f1"
Fixed #36843, #36793 -- Reverted "Fixed #27489 -- Renamed permissions upon
model renaming in migrations."

This reverts commits f02b49d2f3bf84f5225de920ca510149f1f9f1da and
6e89271a8507fe272d11814975500a1b40303a04.
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/36793#comment:16>

Django

unread,
Jan 5, 2026, 3:49:14 PMJan 5
to django-...@googlegroups.com
#36793: Reverting a model rename in an environment with pre-Django 6.0 permission
records leaves wrong users & groups associated
-------------------------------------+-------------------------------------
Reporter: Jacob Walls | Owner: Jacob
| Walls
Type: Bug | Status: closed
Component: contrib.auth | Version: 6.0
Severity: Release blocker | Resolution: fixed
Keywords: | Triage Stage: Ready for
| checkin
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Comment (by Jacob Walls <jacobtylerwalls@…>):

In [changeset:"42bab76258162e1df77d080aa69cac5d803ae90a" 42bab762]:
{{{#!CommitTicketReference repository=""
revision="42bab76258162e1df77d080aa69cac5d803ae90a"
[6.0.x] Fixed #36843, #36793 -- Reverted "Fixed #27489 -- Renamed
permissions upon model renaming in migrations."

This reverts commits f02b49d2f3bf84f5225de920ca510149f1f9f1da and
6e89271a8507fe272d11814975500a1b40303a04.

Backport of 030c63d329c4814da221528e823a4aaaaa40e4f1 from main.
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/36793#comment:17>
Reply all
Reply to author
Forward
0 new messages