django 3.2: get rid of six.PY3 (#64430)
This commit is contained in:
parent
3f335c9bee
commit
112c55fac4
|
@ -495,7 +495,6 @@ class ProfileForm(ModelForm):
|
|||
|
||||
|
||||
import unicodedata
|
||||
from django.utils.six import PY3
|
||||
from django.contrib.auth.tokens import default_token_generator
|
||||
from django.contrib.sites.shortcuts import get_current_site
|
||||
from django.utils.http import urlsafe_base64_encode
|
||||
|
@ -510,10 +509,7 @@ def _unicode_ci_compare(s1, s2):
|
|||
"""
|
||||
normalized1 = unicodedata.normalize('NFKC', s1)
|
||||
normalized2 = unicodedata.normalize('NFKC', s2)
|
||||
if PY3:
|
||||
return normalized1.casefold() == normalized2.casefold()
|
||||
# lower() is the best alternative available on Python 2.
|
||||
return normalized1.lower() == normalized2.lower()
|
||||
return normalized1.casefold() == normalized2.casefold()
|
||||
|
||||
|
||||
class PasswordResetFormWithLogging(PasswordResetForm):
|
||||
|
|
Loading…
Reference in New Issue