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
c48beb10
Unverified
Commit
c48beb10
authored
Apr 02, 2018
by
BaiJiangJie
Committed by
GitHub
Apr 02, 2018
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1 from BaiJiangJie/dev
终端管理用户,资产列表IP字段,domain保存对象
parents
0ca14463
5b65ed8a
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
4 deletions
+5
-4
asset.py
apps/assets/views/asset.py
+4
-3
group.py
apps/users/views/group.py
+1
-1
No files found.
apps/assets/views/asset.py
View file @
c48beb10
...
@@ -28,7 +28,7 @@ from common.mixins import JSONResponseMixin
...
@@ -28,7 +28,7 @@ from common.mixins import JSONResponseMixin
from
common.utils
import
get_object_or_none
,
get_logger
,
is_uuid
from
common.utils
import
get_object_or_none
,
get_logger
,
is_uuid
from
common.const
import
create_success_msg
,
update_success_msg
from
common.const
import
create_success_msg
,
update_success_msg
from
..
import
forms
from
..
import
forms
from
..models
import
Asset
,
AdminUser
,
SystemUser
,
Label
,
Node
from
..models
import
Asset
,
AdminUser
,
SystemUser
,
Label
,
Node
,
Domain
from
..hands
import
AdminUserRequiredMixin
from
..hands
import
AdminUserRequiredMixin
...
@@ -279,6 +279,7 @@ class BulkImportAssetView(AdminUserRequiredMixin, JSONResponseMixin, FormView):
...
@@ -279,6 +279,7 @@ class BulkImportAssetView(AdminUserRequiredMixin, JSONResponseMixin, FormView):
asset_dict
=
dict
(
zip
(
attr
,
row
))
asset_dict
=
dict
(
zip
(
attr
,
row
))
id_
=
asset_dict
.
pop
(
'id'
,
0
)
id_
=
asset_dict
.
pop
(
'id'
,
0
)
for
k
,
v
in
asset_dict
.
items
():
for
k
,
v
in
asset_dict
.
items
():
v
=
v
.
strip
()
if
k
==
'is_active'
:
if
k
==
'is_active'
:
v
=
True
if
v
in
[
'TRUE'
,
1
,
'true'
]
else
False
v
=
True
if
v
in
[
'TRUE'
,
1
,
'true'
]
else
False
elif
k
==
'admin_user'
:
elif
k
==
'admin_user'
:
...
@@ -288,8 +289,8 @@ class BulkImportAssetView(AdminUserRequiredMixin, JSONResponseMixin, FormView):
...
@@ -288,8 +289,8 @@ class BulkImportAssetView(AdminUserRequiredMixin, JSONResponseMixin, FormView):
v
=
int
(
v
)
v
=
int
(
v
)
except
ValueError
:
except
ValueError
:
v
=
0
v
=
0
el
se
:
el
if
k
==
'domain'
:
continue
v
=
get_object_or_none
(
Domain
,
name
=
v
)
asset_dict
[
k
]
=
v
asset_dict
[
k
]
=
v
asset
=
get_object_or_none
(
Asset
,
id
=
id_
)
if
is_uuid
(
id_
)
else
None
asset
=
get_object_or_none
(
Asset
,
id
=
id_
)
if
is_uuid
(
id_
)
else
None
...
...
apps/users/views/group.py
View file @
c48beb10
...
@@ -74,7 +74,7 @@ class UserGroupDetailView(AdminUserRequiredMixin, DetailView):
...
@@ -74,7 +74,7 @@ class UserGroupDetailView(AdminUserRequiredMixin, DetailView):
template_name
=
'users/user_group_detail.html'
template_name
=
'users/user_group_detail.html'
def
get_context_data
(
self
,
**
kwargs
):
def
get_context_data
(
self
,
**
kwargs
):
users
=
User
.
objects
.
exclude
(
id__in
=
self
.
object
.
users
.
all
())
users
=
User
.
objects
.
exclude
(
id__in
=
self
.
object
.
users
.
all
())
.
exclude
(
role
=
User
.
ROLE_APP
)
context
=
{
context
=
{
'app'
:
_
(
'Users'
),
'app'
:
_
(
'Users'
),
'action'
:
_
(
'User group detail'
),
'action'
:
_
(
'User group detail'
),
...
...
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