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
84bd465b
Unverified
Commit
84bd465b
authored
Jan 02, 2019
by
老广
Committed by
GitHub
Jan 02, 2019
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #2296 from jumpserver/dev
Dev
parents
545d4fa6
d0af8eba
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
1 deletion
+4
-1
node.py
apps/assets/api/node.py
+4
-1
No files found.
apps/assets/api/node.py
View file @
84bd465b
...
...
@@ -134,6 +134,9 @@ class NodeChildrenApi(mixins.ListModelMixin, generics.CreateAPIView):
serializer_class
=
serializers
.
NodeSerializer
instance
=
None
def
get
(
self
,
request
,
*
args
,
**
kwargs
):
return
self
.
list
(
request
,
*
args
,
**
kwargs
)
def
post
(
self
,
request
,
*
args
,
**
kwargs
):
instance
=
self
.
get_object
()
if
not
request
.
data
.
get
(
"value"
):
...
...
@@ -154,7 +157,7 @@ class NodeChildrenApi(mixins.ListModelMixin, generics.CreateAPIView):
def
get_object
(
self
):
pk
=
self
.
kwargs
.
get
(
'pk'
)
or
self
.
request
.
query_params
.
get
(
'id'
)
if
not
pk
:
node
=
No
ne
node
=
No
de
.
root
()
else
:
node
=
get_object_or_404
(
Node
,
pk
=
pk
)
return
node
...
...
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