mirror of
https://github.com/jumpserver/jumpserver.git
synced 2025-09-10 11:49:10 +00:00
* Update views.py * Update views.py * Update views.py * Update views.py * Update views.py
This commit is contained in:
@@ -10,6 +10,7 @@ from django.shortcuts import get_object_or_404
|
||||
from django.db.models import Q
|
||||
from juser.user_api import *
|
||||
from jperm.perm_api import get_group_user_perm
|
||||
import re
|
||||
|
||||
MAIL_FROM = EMAIL_HOST_USER
|
||||
|
||||
@@ -173,6 +174,9 @@ def user_add(request):
|
||||
pass
|
||||
else:
|
||||
try:
|
||||
if not re.match(r"^\w+$",username):
|
||||
error = u'用户名不合法'
|
||||
raise ServerError(error)
|
||||
user = db_add_user(username=username, name=name,
|
||||
password=password,
|
||||
email=email, role=role, uuid=uuid_r,
|
||||
|
Reference in New Issue
Block a user