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,15 +17,17 @@
|
||||||
</small>
|
</small>
|
||||||
|
|
||||||
</li>
|
</li>
|
||||||
<li class="row row-flush">
|
{% if show_change_password %}
|
||||||
<div class="col6">
|
<li class="row row-flush">
|
||||||
<a href="{% url 'wagtailadmin_account_change_password' %}" class="button button-primary">Change password</a>
|
<div class="col6">
|
||||||
</div>
|
<a href="{% url 'wagtailadmin_account_change_password' %}" class="button button-primary">Change password</a>
|
||||||
|
</div>
|
||||||
|
|
||||||
<small class="col6">
|
<small class="col6">
|
||||||
Change the password you use to log in.
|
Change the password you use to log in.
|
||||||
</small>
|
</small>
|
||||||
</li>
|
</li>
|
||||||
|
{% endif %}
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
{% endblock %}
|
{% endblock %}
|
|
@ -36,7 +36,9 @@
|
||||||
{{ form.password.label_tag }}
|
{{ form.password.label_tag }}
|
||||||
{{ form.password }}
|
{{ form.password }}
|
||||||
</div>
|
</div>
|
||||||
<p class="help"><a href="{% url 'django.contrib.auth.views.password_reset' %}">Forgotten it?</a></p>
|
{% if show_password_reset %}
|
||||||
|
<p class="help"><a href="{% url 'django.contrib.auth.views.password_reset' %}">Forgotten it?</a></p>
|
||||||
|
{% endif %}
|
||||||
</li>
|
</li>
|
||||||
{% comment %}
|
{% comment %}
|
||||||
Removed until functionality exists
|
Removed until functionality exists
|
||||||
|
|
|
@ -1,8 +1,13 @@
|
||||||
from django.conf.urls import patterns, url
|
from django.conf.urls import patterns, url
|
||||||
|
from django.conf import settings
|
||||||
from wagtail.wagtailadmin.forms import LoginForm, PasswordResetForm
|
from wagtail.wagtailadmin.forms import LoginForm, PasswordResetForm
|
||||||
|
|
||||||
urlpatterns = patterns('django.contrib.auth.views',
|
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/'}),
|
url(r'^logout/$', 'logout', {'next_page': '/admin/login/'}),
|
||||||
|
|
||||||
# Password reset
|
# Password reset
|
||||||
|
|
|
@ -1,10 +1,13 @@
|
||||||
|
from django.conf import settings
|
||||||
from django.shortcuts import render, redirect
|
from django.shortcuts import render, redirect
|
||||||
from django.contrib import messages
|
from django.contrib import messages
|
||||||
from django.contrib.auth.forms import SetPasswordForm
|
from django.contrib.auth.forms import SetPasswordForm
|
||||||
|
|
||||||
|
|
||||||
def account(request):
|
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):
|
def change_password(request):
|
||||||
|
|
Ładowanie…
Reference in New Issue