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
40bac28f
Kaydet (Commit)
40bac28f
authored
Mar 01, 2018
tarafından
Christophe Mehay
Kaydeden (comit)
Tim Graham
Mar 02, 2018
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Fixed #29176 -- Fixed AbstractBaseUser.normalize_username() crash if username isn't a string.
üst
a2e97abd
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
8 additions
and
1 deletion
+8
-1
base_user.py
django/contrib/auth/base_user.py
+1
-1
2.0.3.txt
docs/releases/2.0.3.txt
+3
-0
test_models.py
tests/auth_tests/test_models.py
+4
-0
No files found.
django/contrib/auth/base_user.py
Dosyayı görüntüle @
40bac28f
...
@@ -138,4 +138,4 @@ class AbstractBaseUser(models.Model):
...
@@ -138,4 +138,4 @@ class AbstractBaseUser(models.Model):
@classmethod
@classmethod
def
normalize_username
(
cls
,
username
):
def
normalize_username
(
cls
,
username
):
return
unicodedata
.
normalize
(
'NFKC'
,
username
)
if
username
else
username
return
unicodedata
.
normalize
(
'NFKC'
,
username
)
if
isinstance
(
username
,
str
)
else
username
docs/releases/2.0.3.txt
Dosyayı görüntüle @
40bac28f
...
@@ -28,3 +28,6 @@ Bugfixes
...
@@ -28,3 +28,6 @@ Bugfixes
* Fixed crash when using a ``Window()`` expression in a subquery
* Fixed crash when using a ``Window()`` expression in a subquery
(:ticket:`29172`).
(:ticket:`29172`).
* Fixed ``AbstractBaseUser.normalize_username()`` crash if the ``username``
argument isn't a string (:ticket:`29176`).
tests/auth_tests/test_models.py
Dosyayı görüntüle @
40bac28f
...
@@ -12,6 +12,7 @@ from django.core import mail
...
@@ -12,6 +12,7 @@ from django.core import mail
from
django.db.models.signals
import
post_save
from
django.db.models.signals
import
post_save
from
django.test
import
SimpleTestCase
,
TestCase
,
override_settings
from
django.test
import
SimpleTestCase
,
TestCase
,
override_settings
from
.models
import
IntegerUsernameUser
from
.models.with_custom_email_field
import
CustomEmailField
from
.models.with_custom_email_field
import
CustomEmailField
...
@@ -157,6 +158,9 @@ class UserManagerTestCase(TestCase):
...
@@ -157,6 +158,9 @@ class UserManagerTestCase(TestCase):
class
AbstractBaseUserTests
(
TestCase
):
class
AbstractBaseUserTests
(
TestCase
):
def
test_normalize_username
(
self
):
self
.
assertEqual
(
IntegerUsernameUser
()
.
normalize_username
(
123
),
123
)
def
test_clean_normalize_username
(
self
):
def
test_clean_normalize_username
(
self
):
# The normalization happens in AbstractBaseUser.clean()
# The normalization happens in AbstractBaseUser.clean()
ohm_username
=
'iamtheΩ'
# U+2126 OHM SIGN
ohm_username
=
'iamtheΩ'
# U+2126 OHM SIGN
...
...
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