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
75c8e445
Commit
75c8e445
authored
Apr 16, 2015
by
halcyon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bugs
parent
29d19641
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
4 deletions
+17
-4
views.py
jasset/views.py
+17
-4
No files found.
jasset/views.py
View file @
75c8e445
...
...
@@ -577,15 +577,28 @@ def idc_detail(request):
@require_super_user
def
idc_del
(
request
):
offset
=
request
.
GET
.
get
(
'id'
,
''
)
default_idc
=
IDC
.
objects
.
get
(
id
=
1
)
if
offset
==
'multi'
:
len_list
=
request
.
POST
.
get
(
"len_list"
)
for
i
in
range
(
int
(
len_list
)):
key
=
"id_list["
+
str
(
i
)
+
"]"
gid
=
request
.
POST
.
get
(
key
)
IDC
.
objects
.
filter
(
id
=
gid
)
.
delete
()
idc
=
IDC
.
objects
.
filter
(
id
=
gid
)
if
idc
:
idc_class
=
idc
.
first
()
idc_class
.
asset_set
.
update
(
idc
=
default_idc
)
idc
.
delete
()
else
:
return
httperror
(
request
,
'删除失败, 没有这个IDC!'
)
else
:
gid
=
int
(
offset
)
IDC
.
objects
.
filter
(
id
=
gid
)
.
delete
()
idc
=
IDC
.
objects
.
filter
(
id
=
gid
)
if
idc
:
idc_class
=
idc
.
first
()
idc_class
.
asset_set
.
update
(
idc
=
default_idc
)
idc
.
delete
()
else
:
return
httperror
(
request
,
'删除失败, 没有这个IDC!'
)
return
HttpResponseRedirect
(
'/jasset/idc_list/'
)
...
...
@@ -761,12 +774,12 @@ def group_del(request):
for
i
in
range
(
int
(
len_list
)):
key
=
"id_list["
+
str
(
i
)
+
"]"
gid
=
request
.
POST
.
get
(
key
)
if
not
verify
(
request
,
asset_group
=
[
gid
]):
if
is_group_admin
(
request
)
and
not
verify
(
request
,
asset_group
=
[
gid
]):
return
httperror
(
request
,
'删除失败, 您无权删除!'
)
BisGroup
.
objects
.
filter
(
id
=
gid
)
.
delete
()
else
:
gid
=
int
(
offset
)
if
not
verify
(
request
,
asset_group
=
[
gid
]):
if
is_group_admin
(
request
)
and
not
verify
(
request
,
asset_group
=
[
gid
]):
return
httperror
(
request
,
'删除失败, 您无权删除!'
)
BisGroup
.
objects
.
filter
(
id
=
gid
)
.
delete
()
return
HttpResponseRedirect
(
'/jasset/group_list/'
)
...
...
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