Skip to content

Commit fe066ae

Browse files
committed
fix: Modify password verification regular expression
--bug=1057464 --user=王孝刚 【对话用户】用户-修改密码-修改密码为「Abc123」,修改成功了-与密码规则不符 https://www.tapd.cn/62980211/s/1718453
1 parent 3aa0847 commit fe066ae

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

apps/users/serializers/user.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,10 @@
3535
from django.utils.translation import get_language
3636

3737
PASSWORD_REGEX = re.compile(
38-
r"^(?![a-zA-Z]+$)(?![A-Z0-9]+$)(?![A-Z_!@#$%^&*`~.()-+=]+$)(?![a-z0-9]+$)(?![a-z_!@#$%^&*`~()-+=]+$)"
39-
r"(?![0-9_!@#$%^&*`~()-+=]+$)[a-zA-Z0-9_!@#$%^&*`~.()-+=]{6,20}$"
38+
r"^(?![a-zA-Z]+$)(?![A-Z0-9]+$)(?![A-Z_!@#$%^&*`~.()-+=]+$)"
39+
r"(?![a-z0-9]+$)(?![a-z_!@#$%^&*`~()-+=]+$)(?![0-9_!@#$%^&*`~()-+=]+$)"
40+
r"(?=.*[_!@#$%^&*`~.()-+=])"
41+
r"[a-zA-Z0-9_!@#$%^&*`~.()-+=]{6,20}$"
4042
)
4143

4244
version, get_key = Cache_Version.SYSTEM.value

0 commit comments

Comments
 (0)