Opened 15 years ago

Closed 15 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: no UI/UX: no

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 by dc, 15 years ago

Resolution: duplicate
Status: newclosed

Duplicate of #10061

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