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
05a5e9cc
Commit
05a5e9cc
authored
Nov 02, 2016
by
ibuler
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Finish some bug
parent
34a0a37b
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
10 additions
and
7 deletions
+10
-7
api.py
apps/assets/api.py
+9
-2
forms.py
apps/assets/forms.py
+1
-1
asset_create.html
apps/assets/templates/assets/asset_create.html
+0
-1
asset_update.html
apps/assets/templates/assets/asset_update.html
+0
-1
views.py
apps/assets/views.py
+0
-2
No files found.
apps/assets/api.py
View file @
05a5e9cc
...
...
@@ -73,8 +73,15 @@ class SystemUserAuthApi(APIView):
system_user
=
get_object_or_none
(
SystemUser
,
id
=
system_user_id
,
username
=
system_user_username
)
if
system_user
:
password
=
signer
.
sign
(
system_user
.
password
)
private_key
=
signer
.
sign
(
system_user
.
private_key
)
if
system_user
.
password
:
password
=
signer
.
sign
(
system_user
.
password
)
else
:
password
=
signer
.
sign
(
''
)
if
system_user
.
private_key
:
private_key
=
signer
.
sign
(
system_user
.
private_key
)
else
:
private_key
=
signer
.
sign
(
None
)
response
=
{
'id'
:
system_user
.
id
,
...
...
apps/assets/forms.py
View file @
05a5e9cc
...
...
@@ -242,7 +242,7 @@ class SystemUserForm(forms.ModelForm):
# Todo: Validate private key file, and generate public key
# Todo: Auto generate private key and public key
if
private_key_file
:
system_user
.
private_key
=
private_key_file
.
read
()
system_user
.
private_key
=
private_key_file
.
read
()
.
strip
()
system_user
.
save
()
return
self
.
instance
...
...
apps/assets/templates/assets/asset_create.html
View file @
05a5e9cc
...
...
@@ -20,7 +20,6 @@
<div
class=
"hr-line-dashed"
></div>
<h3>
{% trans 'Asset user' %}
</h3>
{{ form.admin_user|bootstrap_horizontal }}
{{ form.system_users|bootstrap_horizontal }}
<div
class=
"hr-line-dashed"
></div>
<h3>
{% trans 'Other' %}
</h3>
...
...
apps/assets/templates/assets/asset_update.html
View file @
05a5e9cc
...
...
@@ -25,7 +25,6 @@
<div
class=
"hr-line-dashed"
></div>
<h3>
{% trans 'Asset user' %}
</h3>
{{ form.admin_user|bootstrap_horizontal }}
{{ form.system_users|bootstrap_horizontal }}
<div
class=
"hr-line-dashed"
></div>
<h3>
{% trans 'Hardware' %}
</h3>
...
...
apps/assets/views.py
View file @
05a5e9cc
...
...
@@ -46,8 +46,6 @@ class AssetListView(AdminUserRequiredMixin, ListView):
return
super
(
AssetListView
,
self
)
.
get_context_data
(
**
kwargs
)
class
AssetCreateView
(
AdminUserRequiredMixin
,
CreateAssetTagsMiXin
,
CreateView
):
model
=
Asset
tag_type
=
'asset'
...
...
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