Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
D
django
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
Batuhan Osman TASKAYA
django
Commits
ed4c2e1c
Kaydet (Commit)
ed4c2e1c
authored
Mar 24, 2014
tarafından
Tim Graham
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Fixed #22329 -- Used label_tag() in some admin auth templates.
refs #17922.
üst
2cc88403
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
16 additions
and
10 deletions
+16
-10
forms.py
django/contrib/admin/forms.py
+6
-1
sites.py
django/contrib/admin/sites.py
+2
-0
change_password.html
...trib/admin/templates/admin/auth/user/change_password.html
+2
-4
login.html
django/contrib/admin/templates/admin/login.html
+2
-2
password_change_form.html
...ib/admin/templates/registration/password_change_form.html
+3
-3
forms.py
django/contrib/auth/forms.py
+1
-0
No files found.
django/contrib/admin/forms.py
Dosyayı görüntüle @
ed4c2e1c
...
...
@@ -2,7 +2,7 @@ from __future__ import unicode_literals
from
django
import
forms
from
django.contrib.auth.forms
import
AuthenticationForm
from
django.contrib.auth.forms
import
AuthenticationForm
,
PasswordChangeForm
from
django.utils.translation
import
ugettext_lazy
as
_
...
...
@@ -15,6 +15,7 @@ class AdminAuthenticationForm(AuthenticationForm):
"for a staff account. Note that both fields may be "
"case-sensitive."
),
}
required_css_class
=
'required'
def
confirm_login_allowed
(
self
,
user
):
if
not
user
.
is_active
or
not
user
.
is_staff
:
...
...
@@ -23,3 +24,7 @@ class AdminAuthenticationForm(AuthenticationForm):
code
=
'invalid_login'
,
params
=
{
'username'
:
self
.
username_field
.
verbose_name
}
)
class
AdminPasswordChangeForm
(
PasswordChangeForm
):
required_css_class
=
'required'
django/contrib/admin/sites.py
Dosyayı görüntüle @
ed4c2e1c
...
...
@@ -273,10 +273,12 @@ class AdminSite(object):
"""
Handles the "change password" task -- both form display and validation.
"""
from
django.contrib.admin.forms
import
AdminPasswordChangeForm
from
django.contrib.auth.views
import
password_change
url
=
reverse
(
'admin:password_change_done'
,
current_app
=
self
.
name
)
defaults
=
{
'current_app'
:
self
.
name
,
'password_change_form'
:
AdminPasswordChangeForm
,
'post_change_redirect'
:
url
,
'extra_context'
:
self
.
each_context
(),
}
...
...
django/contrib/admin/templates/admin/auth/user/change_password.html
Dosyayı görüntüle @
ed4c2e1c
...
...
@@ -34,14 +34,12 @@
<div
class=
"form-row"
>
{{ form.password1.errors }}
{# TODO: get required class on label_tag #}
<label
for=
"id_password1"
class=
"required"
>
{% trans 'Password' %}:
</label>
{{ form.password1 }}
{{ form.password1.label_tag }} {{ form.password1 }}
</div>
<div
class=
"form-row"
>
{{ form.password2.errors }}
{# TODO: get required class on label_tag #}
<label
for=
"id_password2"
class=
"required"
>
{% trans 'Password (again)' %}:
</label>
{{ form.password2 }}
{{ form.password2.label_tag }} {{ form.password2 }}
<p
class=
"help"
>
{% trans 'Enter the same password as above, for verification.' %}
</p>
</div>
...
...
django/contrib/admin/templates/admin/login.html
Dosyayı görüntüle @
ed4c2e1c
...
...
@@ -30,11 +30,11 @@
<form
action=
"{{ app_path }}"
method=
"post"
id=
"login-form"
>
{% csrf_token %}
<div
class=
"form-row"
>
{{ form.username.errors }}
<label
for=
"id_username"
class=
"required"
>
{{ form.username.label }}:
</label>
{{ form.username }}
{{ form.username.label_tag }}
{{ form.username }}
</div>
<div
class=
"form-row"
>
{{ form.password.errors }}
<label
for=
"id_password"
class=
"required"
>
{% trans 'Password:' %}
</label>
{{ form.password }}
{{ form.password.label_tag }}
{{ form.password }}
<input
type=
"hidden"
name=
"next"
value=
"{{ next }}"
/>
</div>
{% url 'admin_password_reset' as password_reset_url %}
...
...
django/contrib/admin/templates/registration/password_change_form.html
Dosyayı görüntüle @
ed4c2e1c
...
...
@@ -29,17 +29,17 @@
<div
class=
"form-row"
>
{{ form.old_password.errors }}
<label
for=
"id_old_password"
class=
"required"
>
{% trans 'Old password' %}:
</label>
{{ form.old_password }}
{{ form.old_password.label_tag }}
{{ form.old_password }}
</div>
<div
class=
"form-row"
>
{{ form.new_password1.errors }}
<label
for=
"id_new_password1"
class=
"required"
>
{% trans 'New password' %}:
</label>
{{ form.new_password1 }}
{{ form.new_password1.label_tag }}
{{ form.new_password1 }}
</div>
<div
class=
"form-row"
>
{{ form.new_password2.errors }}
<label
for=
"id_new_password2"
class=
"required"
>
{% trans 'Password (again)' %}:
</label>
{{ form.new_password2 }}
{{ form.new_password2.label_tag }}
{{ form.new_password2 }}
</div>
</fieldset>
...
...
django/contrib/auth/forms.py
Dosyayı görüntüle @
ed4c2e1c
...
...
@@ -348,6 +348,7 @@ class AdminPasswordChangeForm(forms.Form):
error_messages
=
{
'password_mismatch'
:
_
(
"The two password fields didn't match."
),
}
required_css_class
=
'required'
password1
=
forms
.
CharField
(
label
=
_
(
"Password"
),
widget
=
forms
.
PasswordInput
)
password2
=
forms
.
CharField
(
label
=
_
(
"Password (again)"
),
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment