Files
jumpserver/apps/common/validators.py
老广 6f494ef09c 校验用户名长度和特殊字符 (#1271)
* [Bugfix] 修复系统用户用户名校验问题

* [Update] 增加长度限制
2018-04-27 11:27:16 +08:00

7 lines
215 B
Python

# -*- coding: utf-8 -*-
#
from django.core.validators import RegexValidator
from django.utils.translation import ugettext_lazy as _
alphanumeric = RegexValidator(r'^[0-9a-zA-Z_-]*$', _('Special char not allowed'))