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

4 views
Skip to first unread message

Django

unread,
Dec 11, 2025, 6:36:16 PM (5 days ago) Dec 11
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 PM (5 days ago) Dec 11
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 AM (4 days ago) Dec 12
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 AM (4 days ago) Dec 12
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 AM (4 days ago) Dec 12
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 AM (4 days ago) Dec 12
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 AM (4 days ago) Dec 12
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 PM (4 days ago) Dec 12
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 PM (4 days ago) Dec 12
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,
10:11 AM (7 hours ago) 10:11 AM
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>
Reply all
Reply to author
Forward
0 new messages