Skip to content

Commit 549c427

Browse files
committed
/admin/: fix login redirects to work with RemoteUserMiddleware; hide password changing functionality (which doesn't work with RemoteUser anyway)
- Legacy-Id: 2121
1 parent b8ca530 commit 549c427

2 files changed

Lines changed: 11 additions & 6 deletions

File tree

django/contrib/admin/sites.py

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -204,12 +204,12 @@ def wrapper(*args, **kwargs):
204204
url(r'^logout/$',
205205
wrap(self.logout),
206206
name='logout'),
207-
url(r'^password_change/$',
208-
wrap(self.password_change, cacheable=True),
209-
name='password_change'),
210-
url(r'^password_change/done/$',
211-
wrap(self.password_change_done, cacheable=True),
212-
name='password_change_done'),
207+
#url(r'^password_change/$',
208+
# wrap(self.password_change, cacheable=True),
209+
# name='password_change'),
210+
#url(r'^password_change/done/$',
211+
# wrap(self.password_change_done, cacheable=True),
212+
# name='password_change_done'),
213213
url(r'^jsi18n/$',
214214
wrap(self.i18n_javascript, cacheable=True),
215215
name='jsi18n'),
@@ -277,6 +277,9 @@ def login(self, request):
277277
"""
278278
Displays the login form for the given HttpRequest.
279279
"""
280+
url = "/accounts/login/?next="+request.get_full_path()
281+
return http.HttpResponseRedirect(url)
282+
280283
from django.contrib.auth.models import User
281284

282285
# If this isn't already the login page, display it.

django/contrib/admin/templates/admin/base.html

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,13 +31,15 @@
3131
{% if docsroot %}
3232
<a href="{{ docsroot }}">{% trans 'Documentation' %}</a> /
3333
{% endif %}
34+
{% comment %}
3435
{% url admin:password_change as password_change_url %}
3536
{% if password_change_url %}
3637
<a href="{{ password_change_url }}">
3738
{% else %}
3839
<a href="{{ root_path }}password_change/">
3940
{% endif %}
4041
{% trans 'Change password' %}</a> /
42+
{% endcomment %}
4143
{% url admin:logout as logout_url %}
4244
{% if logout_url %}
4345
<a href="{{ logout_url }}">

0 commit comments

Comments
 (0)