[Django] #34677: Django Admin built-in password reset feature has UI issues

6 views
Skip to first unread message

Django

unread,
Jun 24, 2023, 5:46:41 PM6/24/23
to django-...@googlegroups.com
#34677: Django Admin built-in password reset feature has UI issues
------------------------------------------+------------------------
Reporter: Yaniv Toledano | Owner: nobody
Type: Bug | Status: new
Component: Uncategorized | Version: 4.2
Severity: Normal | Keywords:
Triage Stage: Unreviewed | Has patch: 0
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 1
UI/UX: 1 |
------------------------------------------+------------------------
The documentation refers to adding password reset features to the admin
site here:
https://docs.djangoproject.com/en/dev/ref/contrib/admin/#adding-a
-password-reset-feature.

The resulting pages are, however, visually inconsistent with the rest of
the admin.

Some examples:
1. Spacing is off.
2. No use of a `class="submit-row" ` css class which makes the button look
off.
3. Header is hardcoded to "Django administration" even though the rest of
the admin has a different branding (e.g., when set under
`admin.site.site_header`, `admin.site.site_title`, etc.).
4. The issues can be resolved here
https://github.com/django/django/tree/650ce967825aa192222391bfe3003c8d97e6f1d0/django/contrib/admin/templates/registration
(specifically only the `password_reset_` templates).

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

Django

unread,
Jun 24, 2023, 5:48:40 PM6/24/23
to django-...@googlegroups.com
#34677: Django Admin built-in password reset feature has UI issues
-------------------------------+--------------------------------------
Reporter: yanivtoledano | Owner: nobody

Type: Bug | Status: new
Component: Uncategorized | Version: 4.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: 1
-------------------------------+--------------------------------------
Changes (by yanivtoledano):

* Attachment "Screenshot 2023-06-24 at 22.48.18.png" added.

Django

unread,
Jun 24, 2023, 5:48:49 PM6/24/23
to django-...@googlegroups.com
#34677: Django Admin built-in password reset feature has UI issues
-------------------------------+--------------------------------------
Reporter: yanivtoledano | Owner: nobody
Type: Bug | Status: new
Component: Uncategorized | Version: 4.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: 1
-------------------------------+--------------------------------------
Changes (by yanivtoledano):

* Attachment "Screenshot 2023-06-24 at 22.47.02.png" added.

Django

unread,
Jun 24, 2023, 5:51:05 PM6/24/23
to django-...@googlegroups.com
#34677: Django Admin built-in password reset feature has UI issues
--------------------------------+--------------------------------------
Reporter: Yaniv Toledano | Owner: nobody
Type: Bug | Status: new
Component: contrib.admin | Version: 4.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: 1
--------------------------------+--------------------------------------
Changes (by Yaniv Toledano):

* component: Uncategorized => contrib.admin


--
Ticket URL: <https://code.djangoproject.com/ticket/34677#comment:1>

Django

unread,
Jun 24, 2023, 11:17:02 PM6/24/23
to django-...@googlegroups.com
#34677: Django Admin built-in password reset feature has UI issues
--------------------------------+--------------------------------------
Reporter: Yaniv Toledano | Owner: nobody
Type: Bug | Status: new
Component: contrib.admin | Version: 4.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: 1
--------------------------------+--------------------------------------

Comment (by Andrew Northall):

The header issues are due to the fact that the view providing the password
reset functionality is not actually part of the admin site, so the
`site_header` context variable is never inserted and reverts to the
default.

This does seem like behaviour which should at least be mentioned in the
documentation. An 'easy' solution to this particular problem would be to
update the documentation to give the following example code, which will
ensure the correct site header is used in the views:


{{{#!python
from django.contrib import admin

admin.site.site_header = "My Admin Site"

urlpatterns = [
path(
"admin/password_reset/",
auth_views.PasswordResetView.as_view(
extra_context={"site_header": admin.site.site_header}
),
name="admin_password_reset",
),
path(
"admin/password_reset/done/",
auth_views.PasswordResetDoneView.as_view(
extra_context={"site_header": admin.site.site_header}
),
name="password_reset_done",
),
path(
"reset/<uidb64>/<token>/",
auth_views.PasswordResetConfirmView.as_view(
extra_context={"site_header": admin.site.site_header}
),
name="password_reset_confirm",
),
path(
"reset/done/",
auth_views.PasswordResetCompleteView.as_view(
extra_context={"site_header": admin.site.site_header}
),
name="password_reset_complete",
),
path("admin/", admin.site.urls),
]
}}}

The alternative solutions to the header issue do not seem practical.

--
Ticket URL: <https://code.djangoproject.com/ticket/34677#comment:2>

Django

unread,
Jun 25, 2023, 6:09:29 AM6/25/23
to django-...@googlegroups.com
#34677: Django Admin built-in password reset feature has UI issues
-------------------------------------+-------------------------------------
Reporter: Yaniv Toledano | Owner: Priyank
| Panchal
Type: Bug | Status: assigned

Component: contrib.admin | Version: 4.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: 1
-------------------------------------+-------------------------------------
Changes (by Priyank Panchal):

* owner: nobody => Priyank Panchal
* status: new => assigned


--
Ticket URL: <https://code.djangoproject.com/ticket/34677#comment:3>

Django

unread,
Jun 26, 2023, 1:09:37 PM6/26/23
to django-...@googlegroups.com
#34677: Django Admin built-in password reset feature has UI issues
-------------------------------------+-------------------------------------
Reporter: Yaniv Toledano | Owner: Priyank
Type: | Panchal
Cleanup/optimization | Status: assigned

Component: contrib.admin | Version: 4.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: 1
-------------------------------------+-------------------------------------
Changes (by Natalia Bidart):

* type: Bug => Cleanup/optimization
* stage: Unreviewed => Accepted


Comment:

Accepting considering I have reproduced the issue about lack of
consistency for admin site header/title and button CSS. I think the
solution for the former should be to update the docs, but do note that we
should provide a code snippet that sets all the relevant variables.

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

Django

unread,
Jun 26, 2023, 1:32:20 PM6/26/23
to django-...@googlegroups.com
#34677: Django Admin built-in password reset feature has UI issues
-------------------------------------+-------------------------------------
Reporter: Yaniv Toledano | Owner: Priyank
Type: | Panchal
Cleanup/optimization | Status: assigned
Component: contrib.admin | Version: 4.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: 1
-------------------------------------+-------------------------------------

Comment (by Natalia Bidart):

Is worth noting that the lack of `class="submit-row"` affects more than
one template, so all password reset related templates should be
audited/fixed.

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

Django

unread,
Jun 26, 2023, 3:16:31 PM6/26/23
to django-...@googlegroups.com
#34677: Django Admin built-in password reset feature has UI issues
-------------------------------------+-------------------------------------
Reporter: Yaniv Toledano | Owner: Priyank
Type: | Panchal
Cleanup/optimization | Status: assigned
Component: contrib.admin | Version: 4.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: 1
-------------------------------------+-------------------------------------

Comment (by Yaniv Toledano):

Replying to [comment:5 Natalia Bidart]:


> Is worth noting that the lack of `class="submit-row"` affects more than
one template, so all password reset related templates should be
audited/fixed.

Agree with this point. I believe the email input field is malformed as
well in comparison to the normal admin layouts.

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

Django

unread,
Jun 30, 2023, 10:05:06 AM6/30/23
to django-...@googlegroups.com
#34677: Django Admin built-in password reset feature has UI issues
-------------------------------------+-------------------------------------
Reporter: Yaniv Toledano | Owner: Priyank
Type: | Panchal
Cleanup/optimization | Status: assigned
Component: contrib.admin | Version: 4.2
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 1

Easy pickings: 1 | UI/UX: 1
-------------------------------------+-------------------------------------
Changes (by Bhuvnesh):

* needs_better_patch: 0 => 1
* has_patch: 0 => 1


Comment:

[https://github.com/django/django/pull/17011 PR]

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

Django

unread,
Jul 1, 2023, 6:31:24 AM7/1/23
to django-...@googlegroups.com
#34677: Django Admin built-in password reset feature has UI issues
-------------------------------------+-------------------------------------
Reporter: Yaniv Toledano | Owner: Priyank
Type: | Panchal
Cleanup/optimization | Status: assigned
Component: contrib.admin | Version: 4.2
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: 1
-------------------------------------+-------------------------------------
Changes (by priyank-panchal-inferenz):

* needs_better_patch: 1 => 0


Comment:

I'm happy for any guidance on what needs to be improved.

--
Ticket URL: <https://code.djangoproject.com/ticket/34677#comment:8>

Django

unread,
Jul 6, 2023, 12:07:43 AM7/6/23
to django-...@googlegroups.com
#34677: Django Admin built-in password reset feature has UI issues
-------------------------------------+-------------------------------------
Reporter: Yaniv Toledano | Owner: Priyank
Type: | Panchal
Cleanup/optimization | Status: assigned
Component: contrib.admin | Version: 4.2
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 1
Needs tests: 1 | Patch needs improvement: 1

Easy pickings: 1 | UI/UX: 1
-------------------------------------+-------------------------------------
Changes (by Mariusz Felisiak):

* needs_better_patch: 0 => 1

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


Comment:

Priyank, please check
[https://code.djangoproject.com/ticket/34677#comment:4 comments].

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

Django

unread,
Jul 8, 2023, 9:38:27 PM7/8/23
to django-...@googlegroups.com
#34677: Django Admin built-in password reset feature has UI issues
-------------------------------------+-------------------------------------
Reporter: Yaniv Toledano | Owner: Priyank
Type: | Panchal
Cleanup/optimization | Status: assigned
Component: contrib.admin | Version: 4.2
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 1
Needs tests: 1 | Patch needs improvement: 1
Easy pickings: 1 | UI/UX: 1
-------------------------------------+-------------------------------------

Comment (by funcy39):

The [https://docs.djangoproject.com/en/dev/ref/contrib/admin/#adding-a
-password-reset-feature link] to the Django document and the version is
dev, but the ticket's version is 4.2. Which is the right version?

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

Django

unread,
Jul 14, 2023, 2:33:32 AM7/14/23
to django-...@googlegroups.com
#34677: Django Admin built-in password reset feature has UI issues
-------------------------------------+-------------------------------------
Reporter: Yaniv Toledano | Owner: Priyank
Type: | Panchal
Cleanup/optimization | Status: assigned
Component: contrib.admin | Version: 4.2
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0

Needs tests: 1 | Patch needs improvement: 1
Easy pickings: 1 | UI/UX: 1
-------------------------------------+-------------------------------------
Changes (by Priyank Panchal):

* needs_docs: 1 => 0


--
Ticket URL: <https://code.djangoproject.com/ticket/34677#comment:11>

Django

unread,
Jul 14, 2023, 3:29:50 AM7/14/23
to django-...@googlegroups.com
#34677: Django Admin built-in password reset feature has UI issues
-------------------------------------+-------------------------------------
Reporter: Yaniv Toledano | Owner: Priyank
Type: | Panchal
Cleanup/optimization | Status: assigned
Component: contrib.admin | Version: 4.2
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 1

Easy pickings: 1 | UI/UX: 1
-------------------------------------+-------------------------------------
Changes (by Mariusz Felisiak):

* needs_tests: 1 => 0


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

Django

unread,
Jul 14, 2023, 5:45:19 AM7/14/23
to django-...@googlegroups.com
#34677: Django Admin built-in password reset feature has UI issues
-------------------------------------+-------------------------------------
Reporter: Yaniv Toledano | Owner: Priyank
Type: | Panchal
Cleanup/optimization | Status: assigned
Component: contrib.admin | Version: 4.2
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: 1
-------------------------------------+-------------------------------------
Changes (by Priyank Panchal):

* needs_better_patch: 1 => 0


--
Ticket URL: <https://code.djangoproject.com/ticket/34677#comment:13>

Django

unread,
Jul 14, 2023, 6:06:46 AM7/14/23
to django-...@googlegroups.com
#34677: Django Admin built-in password reset feature has UI issues
-------------------------------------+-------------------------------------
Reporter: Yaniv Toledano | Owner: Priyank
Type: | Panchal
Cleanup/optimization | Status: assigned
Component: contrib.admin | Version: 4.2
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: 1
-------------------------------------+-------------------------------------
Changes (by Mariusz Felisiak):

* stage: Accepted => Ready for checkin


--
Ticket URL: <https://code.djangoproject.com/ticket/34677#comment:14>

Django

unread,
Jul 14, 2023, 7:09:28 AM7/14/23
to django-...@googlegroups.com
#34677: Django Admin built-in password reset feature has UI issues
-------------------------------------+-------------------------------------
Reporter: Yaniv Toledano | Owner: Priyank
Type: | Panchal
Cleanup/optimization | Status: closed
Component: contrib.admin | Version: 4.2
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: 1
-------------------------------------+-------------------------------------
Changes (by Mariusz Felisiak <felisiak.mariusz@…>):

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


Comment:

In [changeset:"0016a4299569a8f09ff24053ff2b8224f7fa4113" 0016a429]:
{{{
#!CommitTicketReference repository=""
revision="0016a4299569a8f09ff24053ff2b8224f7fa4113"
Fixed #34677 -- Made admin password reset templates more consistent.
}}}

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

Reply all
Reply to author
Forward
0 new messages