Opened 6 years ago

Closed 6 years ago

#11466 closed (duplicate)

Problem with 'logout', 'change password' links in contrib.admin interface

Reported by: gurunars Owned by: nobody
Component: contrib.admin Version: 1.1-beta
Severity: Keywords:
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:

Description

Currently in "django/contrib/admin/templates/admin/base.html" there is a line:

<div id="user-tools">{% trans 'Welcome,' %} <strong>{% firstof user.first_name user.username %}</strong>. {% block userlinks %}{% url django-admindocs-docroot as docsroot %}{% if docsroot %}<a href="{{ docsroot }}">{% trans 'Documentation' %}</a> / {% endif %}<a href="{{ root_path }}password_change/">{% trans 'Change password' %}</a> / <a href="{{ root_path }}logout/">{% trans 'Log out' %}</a>{% endblock %}</div>-->

It should be replaced with:

<div id="user-tools">{% trans 'Welcome,' %} <strong>{% firstof user.first_name user.username %}</strong>. {% block userlinks %}{% url django-admindocs-docroot as docsroot %}{% if docsroot %}<a href="{{ docsroot }}">{% trans 'Documentation' %}</a> / {% endif %}<a href="/{{ root_path }}password_change/">{% trans 'Change password' %}</a> / <a href="/{{ root_path }}logout/">{% trans 'Log out' %}</a>{% endblock %}</div>

Reason:

{{root_path}} variable does not contain a trailing slash. As a result, logout and change password links are relative, not absolute. It leads to 404 error when using the links from the pages other then home one. The solution is to add a trailing slash in front of {{root_path}} variable.


Change History (1)

comment:1 Changed 6 years ago by dc

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Resolution set to duplicate
  • Status changed from new to closed

Duplicate of #10061

Note: See TracTickets for help on using tickets.
Back to Top