#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 <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/01070188f08e01ce-f0d3fadc-b920-4dd2-97ee-32393d5c156e-000000%40eu-central-1.amazonses.com.

Reply via email to