Re: [Django] #36354: Remove unneeded JS from contrib.admin password forms

10 views
Skip to first unread message

Django

unread,
Apr 26, 2025, 3:47:04 AM4/26/25
to django-...@googlegroups.com
#36354: Remove unneeded JS from contrib.admin password forms
-------------------------------------+-------------------------------------
Reporter: Fabian Braun | Owner: (none)
Type: | Status: new
Cleanup/optimization |
Component: contrib.admin | Version: 5.2
Severity: Normal | Resolution:
Keywords: | Triage Stage:
| Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------
Description changed by Fabian Braun:

Old description:

> As part of ticket-34429 (https://code.djangoproject.com/ticket/34429) JS
> was added to the password change and user create forms to ensure that the
> forms run on browsers that do not support the `:has()` CSS selector.
>
> By now, all major browsers support the selector. The last one not
> supporting it (Firefox 115 ESR) is now well beyond end of life. (See
> discussion here:
> https://github.com/django/django/pull/16942/files#r1427864863)
>
> Steps to solve the issue:
> * Remove `admin/js/unusable_password_field.js`
> * Update `admin/auth/user/chamge_password.html` and
> `admin/auth/user/add_form.html` to not load the JS file

New description:

As part of ticket-34429 (https://code.djangoproject.com/ticket/34429) JS
was added to the password change and user create forms to ensure that the
forms run on browsers that do not support the `:has()` CSS selector.

By now, all major browsers support the selector. The last one not
supporting it (Firefox 115 ESR - https://support.mozilla.org/en-US/kb
/firefox-users-windows-7-8-and-81-moving-extended-
support#:~:text=Mozilla%20is%20providing%20critical%20security,supported%20version%20of%20Microsoft%20Windows.)
is reaching end-of support in August 2025, i.e. before the next major
Django release.

(See discussion here:
https://github.com/django/django/pull/16942/files#r1427864863)

Steps to solve the issue:
* Remove `admin/js/unusable_password_field.js`
* Update `admin/auth/user/chamge_password.html` and
`admin/auth/user/add_form.html` to not load the JS file

--
--
Ticket URL: <https://code.djangoproject.com/ticket/36354#comment:2>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Apr 26, 2025, 6:42:51 AM4/26/25
to django-...@googlegroups.com
#36354: Remove unneeded JS from contrib.admin password forms
--------------------------------------+------------------------------------
Reporter: Fabian Braun | Owner: (none)
Type: Cleanup/optimization | Status: new
Component: contrib.admin | Version: 5.2
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
--------------------------------------+------------------------------------
Changes (by Sarah Boyce):

* cc: Nick Pope, Mariusz Felisiak (added)
* stage: Unreviewed => Accepted

Comment:

Based off my understanding, it is reasonable to remove the JavaScript for
the 6.0 release
--
Ticket URL: <https://code.djangoproject.com/ticket/36354#comment:3>

Django

unread,
Apr 26, 2025, 6:44:09 AM4/26/25
to django-...@googlegroups.com
#36354: Remove unneeded JS from contrib.admin password forms
--------------------------------------+------------------------------------
Reporter: Fabian Braun | Owner: (none)
Type: Cleanup/optimization | Status: new
Component: contrib.admin | Version: dev
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
--------------------------------------+------------------------------------
Changes (by David Bogar):

* version: 5.2 => dev

Comment:

Given that the most recent version to not support the {{{:has()}}}
selector is going EOL in August, I think it should be safe to remove this
in 6.0.

Updated version to dev, needs implementation.
--
Ticket URL: <https://code.djangoproject.com/ticket/36354#comment:4>

Django

unread,
Apr 26, 2025, 7:38:20 AM4/26/25
to django-...@googlegroups.com
#36354: Remove unneeded JS from contrib.admin password forms
--------------------------------------+------------------------------------
Reporter: Fabian Braun | Owner: (none)
Type: Cleanup/optimization | Status: new
Component: contrib.admin | Version: dev
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
--------------------------------------+------------------------------------
Changes (by David Bogar):

* cc: David Bogar (added)

--
Ticket URL: <https://code.djangoproject.com/ticket/36354#comment:5>

Django

unread,
Apr 26, 2025, 9:53:28 AM4/26/25
to django-...@googlegroups.com
#36354: Remove unneeded JS from contrib.admin password forms
-------------------------------------+-------------------------------------
Reporter: Fabian Braun | Owner: Fabian
Type: | Braun
Cleanup/optimization | Status: assigned
Component: contrib.admin | Version: dev
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Fabian Braun):

* owner: (none) => Fabian Braun
* status: new => assigned

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

Django

unread,
Apr 26, 2025, 10:11:00 AM4/26/25
to django-...@googlegroups.com
#36354: Remove unneeded JS from contrib.admin password forms
-------------------------------------+-------------------------------------
Reporter: Fabian Braun | Owner: Fabian
Type: | Braun
Cleanup/optimization | Status: assigned
Component: contrib.admin | Version: dev
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Fabian Braun):

* has_patch: 0 => 1

--
Ticket URL: <https://code.djangoproject.com/ticket/36354#comment:7>

Django

unread,
Apr 26, 2025, 12:44:17 PM4/26/25
to django-...@googlegroups.com
#36354: Remove unneeded JS from contrib.admin password forms
-------------------------------------+-------------------------------------
Reporter: Fabian Braun | Owner: Fabian
Type: | Braun
Cleanup/optimization | Status: assigned
Component: contrib.admin | Version: dev
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Bruno Alla):

* has_patch: 1 => 0

Comment:

I'm unsetting the flag because it's showing in the review queue because of
it. However, there is no PR linked to this ticket to review.
--
Ticket URL: <https://code.djangoproject.com/ticket/36354#comment:8>

Django

unread,
Apr 26, 2025, 1:01:23 PM4/26/25
to django-...@googlegroups.com
#36354: Remove unneeded JS from contrib.admin password forms
-------------------------------------+-------------------------------------
Reporter: Fabian Braun | Owner: Fabian
Type: | Braun
Cleanup/optimization | Status: assigned
Component: contrib.admin | Version: dev
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Jacob Walls):

* has_patch: 0 => 1

Comment:

It's here: [https://github.com/django/django/pull/19421 PR]. When in
doubt, the beige box above the comments always has hints about taking the
next step in Trac.
--
Ticket URL: <https://code.djangoproject.com/ticket/36354#comment:9>

Django

unread,
Apr 28, 2025, 2:31:35 PM4/28/25
to django-...@googlegroups.com
#36354: Remove unneeded JS from contrib.admin password forms
-------------------------------------+-------------------------------------
Reporter: Fabian Braun | Owner: Fabian
Type: | Braun
Cleanup/optimization | Status: assigned
Component: contrib.admin | Version: dev
Severity: Normal | Resolution:
Keywords: | Triage Stage: Ready for
| checkin
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Natalia Bidart):

* stage: Accepted => Ready for checkin

--
Ticket URL: <https://code.djangoproject.com/ticket/36354#comment:10>

Django

unread,
Apr 28, 2025, 4:48:31 PM4/28/25
to django-...@googlegroups.com
#36354: Remove unneeded JS from contrib.admin password forms
-------------------------------------+-------------------------------------
Reporter: Fabian Braun | Owner: Fabian
Type: | Braun
Cleanup/optimization | Status: closed
Component: contrib.admin | Version: dev
Severity: Normal | Resolution: fixed
Keywords: | Triage Stage: Ready for
| checkin
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by nessita <124304+nessita@…>):

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

Comment:

In [changeset:"65bbdbd10b25700d1166b1a698e672a4695281bc" 65bbdbd]:
{{{#!CommitTicketReference repository=""
revision="65bbdbd10b25700d1166b1a698e672a4695281bc"
Fixed #36354 -- Removed JavaScript workaround for browsers lacking
`:has()` CSS support.

This branch removes the JavaScript fallback added in the admin for the
add user and change password templates/flows (Refs #34429).

Django documents suport for "modern, web standards compliant browsers".
See https://caniuse.com/css-has for info on browser support per version.
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/36354#comment:11>
Reply all
Reply to author
Forward
0 new messages