Skip to content

Commit

Permalink
[bugfix] 增加LDAP用户时
Browse files Browse the repository at this point in the history
  • Loading branch information
xiaomaoxue committed Apr 18, 2018
1 parent d6cf422 commit 29aec21
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,4 @@ apps/__pycache__/
apps/static/ionicons/
*.pyc
data/*
config.py
2 changes: 1 addition & 1 deletion apps/common/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -382,7 +382,7 @@ def close(self):
self.file_obj.close()


def generate_activation_code(len=20, n=200):
def generate_activation_code(len=20, n=20):
'''生成n个长度为len的随机序列码'''
random.seed()
chars = string.ascii_letters + string.digits
Expand Down
2 changes: 1 addition & 1 deletion apps/users/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ def save(self, commit=True):
if password:
password = password
else:
password = generate_activation_code()
password = generate_activation_code(n=1)[0]
status = ldap_tool.ldap_add_user(cn, mail, username, password)
if status:
msg = "ldap用户创建成功"
Expand Down

0 comments on commit 29aec21

Please sign in to comment.