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
e8f69609
Kaydet (Commit)
e8f69609
authored
Kas 07, 2012
tarafından
Tim Graham
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Fixed #19161 - Added missing clean_password method in custom user docs
Thanks DavidW for the report.
üst
a386675a
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
2 deletions
+8
-2
auth.txt
docs/topics/auth.txt
+8
-2
No files found.
docs/topics/auth.txt
Dosyayı görüntüle @
e8f69609
...
@@ -408,7 +408,7 @@ installation supports. The first entry in this list (that is,
...
@@ -408,7 +408,7 @@ installation supports. The first entry in this list (that is,
``settings.PASSWORD_HASHERS[0]``) will be used to store passwords, and all the
``settings.PASSWORD_HASHERS[0]``) will be used to store passwords, and all the
other entries are valid hashers that can be used to check existing passwords.
other entries are valid hashers that can be used to check existing passwords.
This means that if you want to use a different algorithm, you'll need to modify
This means that if you want to use a different algorithm, you'll need to modify
:setting:`PASSWORD_HASHERS` to list your prefered algorithm first in the list.
:setting:`PASSWORD_HASHERS` to list your prefer
r
ed algorithm first in the list.
The default for :setting:`PASSWORD_HASHERS` is::
The default for :setting:`PASSWORD_HASHERS` is::
...
@@ -2283,13 +2283,19 @@ code would be required in the app's ``admin.py`` file::
...
@@ -2283,13 +2283,19 @@ code would be required in the app's ``admin.py`` file::
class UserChangeForm(forms.ModelForm):
class UserChangeForm(forms.ModelForm):
"""A form for updateing users. Includes all the fields on
"""A form for updateing users. Includes all the fields on
the user, but replaces the password field with admin's
the user, but replaces the password field with admin's
pasword hash display field.
pas
s
word hash display field.
"""
"""
password = ReadOnlyPasswordHashField()
password = ReadOnlyPasswordHashField()
class Meta:
class Meta:
model = MyUser
model = MyUser
def clean_password(self):
# Regardless of what the user provides, return the initial value.
# This is done here, rather than on the field, because the
# field does not have access to the initial value
return self.initial["password"]
class MyUserAdmin(UserAdmin):
class MyUserAdmin(UserAdmin):
# The forms to add and change user instances
# The forms to add and change user instances
...
...
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