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
e22e832d
Unverified
Commit
e22e832d
authored
Nov 30, 2018
by
老广
Committed by
GitHub
Nov 30, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[Bugfix] 修复批量更新时 节点和标签是增加而不是覆盖 (#2115)
parent
8f479e36
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
5 deletions
+5
-5
asset.py
apps/assets/forms/asset.py
+5
-5
No files found.
apps/assets/forms/asset.py
View file @
e22e832d
...
@@ -142,14 +142,14 @@ class AssetBulkUpdateForm(OrgModelForm):
...
@@ -142,14 +142,14 @@ class AssetBulkUpdateForm(OrgModelForm):
if
k
in
changed_fields
}
if
k
in
changed_fields
}
assets
=
cleaned_data
.
pop
(
'assets'
)
assets
=
cleaned_data
.
pop
(
'assets'
)
labels
=
cleaned_data
.
pop
(
'labels'
,
[])
labels
=
cleaned_data
.
pop
(
'labels'
,
[])
nodes
=
cleaned_data
.
pop
(
'nodes'
)
nodes
=
cleaned_data
.
pop
(
'nodes'
,
None
)
assets
=
Asset
.
objects
.
filter
(
id__in
=
[
asset
.
id
for
asset
in
assets
])
assets
=
Asset
.
objects
.
filter
(
id__in
=
[
asset
.
id
for
asset
in
assets
])
assets
.
update
(
**
cleaned_data
)
assets
.
update
(
**
cleaned_data
)
if
labels
:
if
labels
:
for
label
in
label
s
:
for
asset
in
asset
s
:
label
.
assets
.
add
(
*
tuple
(
assets
)
)
asset
.
labels
.
set
(
labels
)
if
nodes
:
if
nodes
:
for
node
in
node
s
:
for
asset
in
asset
s
:
node
.
assets
.
add
(
*
tuple
(
assets
)
)
asset
.
nodes
.
set
(
nodes
)
return
assets
return
assets
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