views: define a title for the "password change" view (#22407)
This commit is contained in:
parent
2bc22ef75d
commit
7e519f12dd
|
@ -30,6 +30,7 @@ def password_change_view(request, *args, **kwargs):
|
|||
return redirect(request, post_change_redirect)
|
||||
kwargs['post_change_redirect'] = post_change_redirect
|
||||
extra_context = kwargs.setdefault('extra_context', {})
|
||||
extra_context['view'] = password_change_view
|
||||
extra_context[REDIRECT_FIELD_NAME] = post_change_redirect
|
||||
if not request.user.has_usable_password():
|
||||
kwargs['password_change_form'] = SET_PASSWORD_FORM_CLASS
|
||||
|
@ -39,6 +40,9 @@ def password_change_view(request, *args, **kwargs):
|
|||
messages.info(request, _('Password changed'))
|
||||
return response
|
||||
|
||||
password_change_view.title = _('Password Change')
|
||||
password_change_view.do_not_call_in_templates = True
|
||||
|
||||
|
||||
urlpatterns = patterns('authentic2.views',
|
||||
url(r'^logged-in/$', 'logged_in', name='logged-in'),
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
{% load i18n %}
|
||||
|
||||
{% block title %}
|
||||
{% trans "Changing password" %}
|
||||
{{ view.title }}
|
||||
{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
|
|
|
@ -2,13 +2,13 @@
|
|||
{% load i18n %}
|
||||
|
||||
{% block page-title %}
|
||||
{{ block.super }} - {% trans "Change your password" %}
|
||||
{{ block.super }} - {{ view.title }}
|
||||
{% endblock %}
|
||||
|
||||
{% block breadcrumb %}
|
||||
{{ block.super }}
|
||||
<a href="../..">{% trans "Your account" %}</a>
|
||||
<a href="">{% trans "Change your password" %}</a>
|
||||
<a href="">{{ view.title }}</a>
|
||||
{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
|
|
Loading…
Reference in New Issue