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
f4c080dd
Commit
f4c080dd
authored
Sep 16, 2019
by
BaiJiangJie
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[Update] API允许批量删除用户,修改前端提示信息逻辑
parent
b3e20b8b
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
9 deletions
+14
-9
user.py
apps/users/api/user.py
+4
-2
user_list.html
apps/users/templates/users/user_list.html
+10
-7
No files found.
apps/users/api/user.py
View file @
f4c080dd
...
@@ -60,8 +60,10 @@ class UserViewSet(IDInCacheFilterMixin, BulkModelViewSet):
...
@@ -60,8 +60,10 @@ class UserViewSet(IDInCacheFilterMixin, BulkModelViewSet):
self
.
permission_classes
=
(
IsOrgAdminOrAppUser
,)
self
.
permission_classes
=
(
IsOrgAdminOrAppUser
,)
return
super
()
.
get_permissions
()
return
super
()
.
get_permissions
()
def
allow_bulk_destroy
(
self
,
qs
,
filtered
):
def
perform_bulk_destroy
(
self
,
objects
):
return
False
for
obj
in
objects
:
self
.
check_object_permissions
(
self
.
request
,
obj
)
self
.
perform_destroy
(
obj
)
def
perform_bulk_update
(
self
,
serializer
):
def
perform_bulk_update
(
self
,
serializer
):
# TODO: 需要测试
# TODO: 需要测试
...
...
apps/users/templates/users/user_list.html
View file @
f4c080dd
...
@@ -258,12 +258,7 @@ $(document).ready(function(){
...
@@ -258,12 +258,7 @@ $(document).ready(function(){
},
function
()
{
},
function
()
{
function
success
(
data
)
{
function
success
(
data
)
{
url
=
setUrlParam
(
the_url
,
'spm'
,
data
.
spm
);
url
=
setUrlParam
(
the_url
,
'spm'
,
data
.
spm
);
requestApi
({
function
success
()
{
url
:
url
,
method
:
'DELETE'
,
success
:
reloadPage
,
flash_message
:
false
,
});
var
msg
=
"{% trans 'User Deleted.' %}"
;
var
msg
=
"{% trans 'User Deleted.' %}"
;
swal
(
"{% trans 'User Delete' %}"
,
msg
,
"success"
);
swal
(
"{% trans 'User Delete' %}"
,
msg
,
"success"
);
}
}
...
@@ -271,12 +266,20 @@ $(document).ready(function(){
...
@@ -271,12 +266,20 @@ $(document).ready(function(){
var
msg
=
"{% trans 'User Deleting failed.' %}"
;
var
msg
=
"{% trans 'User Deleting failed.' %}"
;
swal
(
"{% trans 'User Delete' %}"
,
msg
,
"error"
);
swal
(
"{% trans 'User Delete' %}"
,
msg
,
"error"
);
}
}
requestApi
({
url
:
url
,
method
:
'DELETE'
,
flash_message
:
true
,
success
:
reloadPage
,
error
:
fail
});
}
requestApi
({
requestApi
({
url
:
"{% url 'api-common:resources-cache' %}"
,
url
:
"{% url 'api-common:resources-cache' %}"
,
method
:
'POST'
,
method
:
'POST'
,
body
:
JSON
.
stringify
(
data
),
body
:
JSON
.
stringify
(
data
),
flash_message
:
false
,
success
:
success
,
success
:
success
,
error
:
fail
})
})
})
})
}
}
...
...
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