kopia lustrzana https://github.com/wagtail/wagtail
merge 002b896e45b48c5ca80c3ed3cb8f4a2f921f8af8 (allow password management to be enabled/disabled by the WAGTAIL_PASSWORD_MANAGEMENT_ENABLED setting). Need to apply manually because git chokes on the lack of submodules on the feature/user-account-settings branch.
rodzic
ada7961207
commit
49ddbaae90
|
@ -17,6 +17,7 @@
|
|||
</small>
|
||||
|
||||
</li>
|
||||
{% if show_change_password %}
|
||||
<li class="row row-flush">
|
||||
<div class="col6">
|
||||
<a href="{% url 'wagtailadmin_account_change_password' %}" class="button button-primary">Change password</a>
|
||||
|
@ -26,6 +27,7 @@
|
|||
Change the password you use to log in.
|
||||
</small>
|
||||
</li>
|
||||
{% endif %}
|
||||
</ul>
|
||||
</div>
|
||||
{% endblock %}
|
|
@ -36,7 +36,9 @@
|
|||
{{ form.password.label_tag }}
|
||||
{{ form.password }}
|
||||
</div>
|
||||
{% if show_password_reset %}
|
||||
<p class="help"><a href="{% url 'django.contrib.auth.views.password_reset' %}">Forgotten it?</a></p>
|
||||
{% endif %}
|
||||
</li>
|
||||
{% comment %}
|
||||
Removed until functionality exists
|
||||
|
|
|
@ -1,8 +1,13 @@
|
|||
from django.conf.urls import patterns, url
|
||||
from django.conf import settings
|
||||
from wagtail.wagtailadmin.forms import LoginForm, PasswordResetForm
|
||||
|
||||
urlpatterns = patterns('django.contrib.auth.views',
|
||||
url(r'^login/$', 'login', {'template_name': 'wagtailadmin/login.html', 'authentication_form': LoginForm}),
|
||||
url(r'^login/$', 'login', {
|
||||
'template_name': 'wagtailadmin/login.html',
|
||||
'authentication_form': LoginForm,
|
||||
'extra_context': {'show_password_reset': getattr(settings, 'WAGTAIL_PASSWORD_MANAGEMENT_ENABLED', True)},
|
||||
}),
|
||||
url(r'^logout/$', 'logout', {'next_page': '/admin/login/'}),
|
||||
|
||||
# Password reset
|
||||
|
|
|
@ -1,10 +1,13 @@
|
|||
from django.conf import settings
|
||||
from django.shortcuts import render, redirect
|
||||
from django.contrib import messages
|
||||
from django.contrib.auth.forms import SetPasswordForm
|
||||
|
||||
|
||||
def account(request):
|
||||
return render(request, 'wagtailadmin/account/account.html')
|
||||
return render(request, 'wagtailadmin/account/account.html', {
|
||||
'show_change_password': getattr(settings, 'WAGTAIL_PASSWORD_MANAGEMENT_ENABLED', True) and request.user.has_usable_password(),
|
||||
})
|
||||
|
||||
|
||||
def change_password(request):
|
||||
|
|
Ładowanie…
Reference in New Issue