mirror of
https://github.com/pgadmin-org/pgadmin4.git
synced 2024-07-07 04:53:25 -05:00
Remove the use of is_normalized function for Python 3.7.
This commit is contained in:
parent
dfaea944f0
commit
f66bd4bcfb
|
@ -10,7 +10,11 @@
|
|||
"""Implements pgAdmin4 User Management Utility"""
|
||||
|
||||
import json
|
||||
from unicodedata import normalize, is_normalized
|
||||
|
||||
import sys
|
||||
if sys.version_info >= (3, 8):
|
||||
from unicodedata import normalize, is_normalized
|
||||
|
||||
from flask import render_template, request, \
|
||||
Response, abort, current_app, session
|
||||
from flask_babel import gettext as _
|
||||
|
@ -442,6 +446,10 @@ def normalise_password(password):
|
|||
'NFKD'
|
||||
)
|
||||
|
||||
# Remove check of Python version once Python 3.7 support ends
|
||||
if sys.version_info < (3, 8):
|
||||
return password
|
||||
|
||||
return password if is_normalized(normalise_form, password) else\
|
||||
normalize(normalise_form, password)
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user