Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
J
jumpserver
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ops
jumpserver
Commits
0a35f757
Commit
0a35f757
authored
Feb 24, 2016
by
ibuler
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
modify(function arg) only for writing style
修改函数使用kwarg
parent
f60a8969
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
3 deletions
+3
-3
user_api.py
juser/user_api.py
+1
-1
views.py
juser/views.py
+2
-2
No files found.
juser/user_api.py
View file @
0a35f757
...
...
@@ -183,7 +183,7 @@ def server_del_user(username):
bash
(
'userdel -r
%
s'
%
username
)
def
get_display_msg
(
user
,
password
,
ssh_key_pwd
,
send_mail_need
=
False
):
def
get_display_msg
(
user
,
password
=
''
,
ssh_key_pwd
=
''
,
send_mail_need
=
False
):
if
send_mail_need
:
msg
=
u'添加用户
%
s 成功! 用户密码已发送到
%
s 邮箱!'
%
(
user
.
name
,
user
.
email
)
else
:
...
...
juser/views.py
View file @
0a35f757
...
...
@@ -175,7 +175,7 @@ def user_add(request):
ssh_key_pwd
=
ssh_key_pwd
,
is_active
=
is_active
,
date_joined
=
datetime
.
datetime
.
now
())
server_add_user
(
username
,
ssh_key_pwd
)
server_add_user
(
username
=
username
,
ssh_key_pwd
=
ssh_key_pwd
)
user
=
get_object
(
User
,
username
=
username
)
if
groups
:
user_groups
=
[]
...
...
@@ -192,7 +192,7 @@ def user_add(request):
else
:
if
MAIL_ENABLE
and
send_mail_need
:
user_add_mail
(
user
,
kwargs
=
locals
())
msg
=
get_display_msg
(
user
,
password
,
ssh_key_pwd
,
send_mail_need
)
msg
=
get_display_msg
(
user
,
password
=
password
,
ssh_key_pwd
=
ssh_key_pwd
,
send_mail_need
=
send_mail_need
)
return
my_render
(
'juser/user_add.html'
,
locals
(),
request
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment