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
84207b61
Kaydet (Commit)
84207b61
authored
Mar 03, 2014
tarafından
Russell Keith-Magee
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Edited contrib.auth check messages for grammar and consistency.
üst
3c5fc708
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
17 deletions
+14
-17
checks.py
django/contrib/auth/checks.py
+6
-9
test_management.py
django/contrib/auth/tests/test_management.py
+8
-8
No files found.
django/contrib/auth/checks.py
Dosyayı görüntüle @
84207b61
...
...
@@ -15,7 +15,7 @@ def check_user_model(**kwargs):
if
not
isinstance
(
cls
.
REQUIRED_FIELDS
,
(
list
,
tuple
)):
errors
.
append
(
checks
.
Error
(
'The REQUIRED_FIELDS must be a list or tuple.'
,
"'REQUIRED_FIELDS' must be a list or tuple."
,
hint
=
None
,
obj
=
cls
,
id
=
'auth.E001'
,
...
...
@@ -26,9 +26,8 @@ def check_user_model(**kwargs):
if
cls
.
USERNAME_FIELD
in
cls
.
REQUIRED_FIELDS
:
errors
.
append
(
checks
.
Error
(
(
'The field named as the USERNAME_FIELD '
'must not be included in REQUIRED_FIELDS '
'on a custom user model.'
),
(
"The field named as the 'USERNAME_FIELD' "
"for a custom user model must not be included in 'REQUIRED_FIELDS'."
),
hint
=
None
,
obj
=
cls
,
id
=
'auth.E002'
,
...
...
@@ -41,8 +40,7 @@ def check_user_model(**kwargs):
(
'django.contrib.auth.backends.ModelBackend'
,)):
errors
.
append
(
checks
.
Error
(
(
'The
%
s.
%
s field must be unique because it is '
'pointed to by USERNAME_FIELD.'
)
%
(
"'
%
s.
%
s' must be unique because it is named as the 'USERNAME_FIELD'."
%
(
cls
.
_meta
.
object_name
,
cls
.
USERNAME_FIELD
),
hint
=
None
,
...
...
@@ -53,11 +51,10 @@ def check_user_model(**kwargs):
else
:
errors
.
append
(
checks
.
Warning
(
(
'The
%
s.
%
s field is pointed to by USERNAME_FIELD, '
'but it is not unique.'
)
%
(
"'
%
s.
%
s' is named as the 'USERNAME_FIELD', but it is not unique."
%
(
cls
.
_meta
.
object_name
,
cls
.
USERNAME_FIELD
),
hint
=
(
'Ensure that your authentication backend can handle '
hint
=
(
'Ensure that your authentication backend
(s)
can handle '
'non-unique usernames.'
),
obj
=
cls
,
id
=
'auth.W004'
,
...
...
django/contrib/auth/tests/test_management.py
Dosyayı görüntüle @
84207b61
...
...
@@ -358,7 +358,7 @@ class CustomUserModelValidationTestCase(TestCase):
errors
=
checks
.
run_checks
()
expected
=
[
checks
.
Error
(
'The REQUIRED_FIELDS must be a list or tuple.'
,
"'REQUIRED_FIELDS' must be a list or tuple."
,
hint
=
None
,
obj
=
CustomUserNonListRequiredFields
,
id
=
'auth.E001'
,
...
...
@@ -375,8 +375,8 @@ class CustomUserModelValidationTestCase(TestCase):
errors
=
checks
.
run_checks
()
expected
=
[
checks
.
Error
(
(
'The field named as the USERNAME_FIELD must not be included '
'in REQUIRED_FIELDS on a custom user model.'
),
(
"The field named as the 'USERNAME_FIELD' for a custom user model "
"must not be included in 'REQUIRED_FIELDS'."
),
hint
=
None
,
obj
=
CustomUserBadRequiredFields
,
id
=
'auth.E002'
,
...
...
@@ -393,8 +393,8 @@ class CustomUserModelValidationTestCase(TestCase):
errors
=
checks
.
run_checks
()
expected
=
[
checks
.
Error
(
(
'The CustomUserNonUniqueUsername.username field must be '
'unique because it is pointed to by USERNAME_FIELD.'
),
(
"'CustomUserNonUniqueUsername.username' must be "
"unique because it is named as the 'USERNAME_FIELD'."
),
hint
=
None
,
obj
=
CustomUserNonUniqueUsername
,
id
=
'auth.E003'
,
...
...
@@ -416,9 +416,9 @@ class CustomUserModelValidationTestCase(TestCase):
errors
=
checks
.
run_checks
()
expected
=
[
checks
.
Warning
(
(
'The CustomUserNonUniqueUsername.username field is pointed to '
'by USERNAME_FIELD, but it is not unique.'
),
hint
=
(
'Ensure that your authentication backend can handle '
(
"'CustomUserNonUniqueUsername.username' is named as "
"the 'USERNAME_FIELD', but it is not unique."
),
hint
=
(
'Ensure that your authentication backend
(s)
can handle '
'non-unique usernames.'
),
obj
=
CustomUserNonUniqueUsername
,
id
=
'auth.W004'
,
...
...
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